當前位置: 首頁> 函數類別大全> soundex

soundex

計算字符串的soundex鍵
名稱:soundex
分類:字符串
所屬語言:php
一句話介紹:計算字符串的soundex 鍵。

定義和用法

soundex()函數計算字符串的soundex 鍵。

soundex 鍵是4 字符長的字母數字字符串,表示單詞的英文發音。

soundex()函數可用於拼寫檢查應用程序。

註釋: soundex()函數為發音相似的單詞創建相同的鍵。

提示: metaphone()soundex()函數更精確,因為metaphone()了解英語發音的基本規則。

實例

例子1

計算"Hello" 的soundex 鍵:

 <?php
$str = "Shanghai" ;
echo soundex ( $str ) ;
?>

親自試一試

例子2

對兩個發音相似的單詞使用soundex() 函數:

 <?php
$str = "Assistance" ;
$str2 = "Assistants" ;

echo soundex ( $str ) ;
echo "<br>" ;
echo soundex ( $str2 ) ;
?>

親自試一試

文法

soundex ( string )
參數描述
string必需。規定要檢查的字符串。
同類函數
  • 隨機打亂一個字符串 str_shuffle

    str_shuffle

    隨機打亂一個字符串
  • 將字符串拆分為較小的塊 chunk_split

    chunk_split

    將字符串拆分為較小的塊
  • 計算給定文件的md5哈希值 md5_file

    md5_file

    計算給定文件的md5哈希值
  • 使用一個字符串分割另一個字符串為數組 explode

    explode

    使用一個字符串分割另一個字符串為數組
  • 從字符串中刪除HTML和PHP標記 strip_tags

    strip_tags

    從字符串中刪除HTML和PHP標記
  • 二進制安全比較字符串開頭的若干個字符(不區分大小寫) strncasecmp

    strncasecmp

    二進制安全比較字符串開頭的若干個字符(不
  • 不區分大小寫的strstr stristr

    stristr

    不區分大小寫的strstr
  • 根據指定格式解析輸入的字符 sscanf

    sscanf

    根據指定格式解析輸入的字符
熱門文章