soundex() 函數計算字符串的 soundex 鍵。
soundex 鍵是 4 字符長的字母數字字符串,表示一個單詞的英文發音。
soundex() 函數可用于拼寫檢查程序。
注釋:soundex() 函數為發音相似的單詞創建相同的鍵。
提示: metaphone() 比 soundex() 函數更精確,因為 metaphone() 了解英語發音的基本規則。
參數 | 描述 |
---|---|
string | 必需。規定要檢查的字符串。 |
返回值: | 如果成功則返回字符串的 soundex 鍵,如果失敗則返回 FALSE。 |
---|---|
PHP 版本: | 4+ |
對兩個發音相似的單詞使用 soundex() 函數: