soundex

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:

Steal the example from metaphone() for comparison
 <?php $words = array ('shoos', 'shoes', 'chute', 'schuss'); foreach ($words as $word_one) { $key_one = soundex ($word_one); echo "\n'$word_one' ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.