The metaphone() function calculates the metaphone key of a string.A metaphone key represents how a string sounds if said by an English speaking person.The metaphone() function can be used for spelling applications.
The metaphone() function creates the same key for similar sounding words.The generated metaphone keys vary in length.
string metaphone ( string $str [, int $phonemes = 0 ] )
Calculates the metaphone key of str.
Similar to soundex() metaphone creates the same key for similar sounding words. It's more accurate than soundex() as it knows the basic rules of English pronunciation. The metaphone generated keys are of variable length.
Metaphone was developed by Lawrence Philips
string(7) "PRKRMNK" string(6) "PRKRMR"
string(5) "PRKRM" string(5) "PRKRM"
Parameter | Description |
---|---|
str | The input string. |
phonemes | This parameter restricts the returned metaphone key to phonemes characters in length. The default value of 0 means no restriction. |
Returns the metaphone key as a string, or FALSE on failure.