soundex
soundex
Calculate the soundex key of a string
string **soundex** string $string
Calculates the soundex key of .
string
Soundex keys have the property that words pronounced similarly produce the same soundex key, and can thus be used to simplify searches in databases where you know the pronunciation but not the spelling.
This particular soundex function is one described by Donald Knuth in "The Art Of Computer Programming, vol. 3: Sorting And Searching", Addison-Wesley (1973), pp. 391-392.
stringThe input string.
Returns the soundex key as a string with four characters.
If at least one letter is contained in , the returned
string starts with a letter. Otherwise is returned.
string``"0000"
Voorbeeld: Soundex Examples
<?php
echo soundex("Euler"), PHP_EOL, soundex("Ellery"), PHP_EOL;
soundex("Euler") == soundex("Ellery"); // E460
soundex("Gauss") == soundex("Ghosh"); // G200
soundex("Hilbert") == soundex("Heilbronn"); // H416
soundex("Knuth") == soundex("Kant"); // K530
soundex("Lloyd") == soundex("Ladd"); // L300
soundex("Lukasiewicz") == soundex("Lissajous"); // L222
?>
levenshtein``metaphone``similar_text