soundex() 函數(shù)計(jì)算字符串的 soundex 鍵。
soundex 鍵是 4 字符長的字母數(shù)字字符串,表示單詞的英文發(fā)音。
soundex() 函數(shù)可用于拼寫檢查應(yīng)用程序。
注釋:soundex() 函數(shù)為發(fā)音相似的單詞創(chuàng)建相同的鍵。
提示:metaphone() 比 soundex() 函數(shù)更精確,因?yàn)?metaphone() 了解英語發(fā)音的基本規(guī)則。
soundex(string)
參數(shù) | 描述 |
---|---|
string | 必需。規(guī)定要檢查的字符串。 |
返回值: | 如果成功則返回字符串的 soundex 鍵,如果失敗則返回 FALSE。 |
PHP 版本: | 4+ |
對兩個(gè)發(fā)音相似的單詞使用 soundex() 函數(shù):
<?php $str = "Assistance"; $str2 = "Assistants"; echo soundex($str); echo "<br>"; echo soundex($str2); ?>
如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答??! 點(diǎn)擊進(jìn)入論壇
Powered by 365建站網(wǎng) RSS地圖 HTML地圖
copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號