Definition and usage
This metaphone () function computes a key string of metaphone.
The key to a metaphone is how a series of voices are spoken by English speakers.
This metaphone () function can be used for spelling applications.
This function returns the success or FALSE of the metaphone key string.
Metaphone (string, length)
Parameter |
Description |
String |
Required. Specified string check
|
Length |
Optional. Specify the maximum length metaphone.
|
Tips and instructions
Note: The metaphone () function creates similar beautiful words with the same key.
Note: generate metaphone keys with different lengths.
Tip: metaphone () is more accurate than soundex (), because metaphone () knows the English pronunciation of basic rules.
Example 1
<? Phpecho metaphone ("world") ;?>
Output.
WRLT
In this example, we use the metaphone () function in two similar beautiful words:
<? Php $ str = "Sun"; $ str2 = "Son"; echo metaphone ($ str); echo "<br/>"; echo metaphone ($ str2);?>
Output.
SNSN
Www.111cn.net/phper/php.html