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.cn/phper/php.html