September 2001
Intermediate to advanced
768 pages
32h 45m
English
string soundex(string string) Calculate a string’s soundex key
Returns:
String containing a soundex key; FALSE on error
Description:
soundex() calculates the soundex key for a string. Soundex keys are short alphanumeric representations of a word’s English pronunciation.
Version:
PHP 3+, PHP 4+
See also:
To analyze the similarity of two strings:
levenshtein() similar_text()
Another method for generating phonetic-based keys:
metaphone()
Full description of the soundex algorithm:
The Art of Computer Programming, Volume 3 (Donald Knuth)
Example:
<?php $words = array ('shoos', 'shoes', 'chute', 'schuss'); foreach ($words as $word_one) { $key_one = soundex ($word_one); echo "\n'$word_one' ... |
Read now
Unlock full access