PHP Metaphone () function parsing, Phpmetaphone
PHP Metaphone () function calculates the Metaphone key of the string, this article introduces the basic usage and example of PHP Metaphone () function to the code farmers, the code farmer can refer to the methods and examples of this article.
Definition and usage
The Metaphone () function computes the Metaphone key for the string.
The Metaphone key represents the English pronunciation of the string.
The Metaphone () function is useful for spell checker.
Note: the Metaphone () function creates the same key for a word that sounds similar.
Note: The resulting metaphone key length is variable.
Tip: Metaphone () is more accurate than the SOUNDEX () function because Metaphone () understands the basic rules of English pronunciation.
Grammar
Metaphone (String,length)
Parameters |
Description |
String |
Necessary. Specifies the string to check. |
Length |
Optional. Specifies the maximum length of the Metaphone key. |
Technical details
return value: |
Returns the Metaphone key of the string if successful, or FALSE if it fails. |
PHP version: |
4 + |
Instance
Example 1
Use the Metaphone () function for two words that are similar in pronunciation:
"; Echo Metaphone ($str 2);? >
Run online
Example 2
Use the length parameter:
"; Echo Metaphone ($str 2,5);? >
Run online
Original address: http://www.manongjc.com/article/816.html
http://www.bkjia.com/PHPjc/1126419.html www.bkjia.com true http://www.bkjia.com/PHPjc/1126419.html techarticle php Metaphone () function parsing, phpmetaphone PHP metaphone () function to calculate the Metaphone key of the string, this article to the Code Farmers introduce PHP Metaphone () function basic usage and examples, need ...