Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

string soundex(string text)


The soundex function returns an identifier based on how a word sounds when spoken.
Similar-sounding words will have similar or identical soundex codes. The soundex code
is four characters and starts with a letter. Compare this function to the similar_text and
the metaphone functions.


The soundex algorithm was described by Donald Knuth in Volume 3 of The Art of
Computer Programming.


<?
print(soundex("lion"));
print("
");
print(soundex("lying"));
?>


Strings

Free download pdf