YouTip LogoYouTip

Func String Soundex

# PHP soundex() Function [![Image 3: PHP String Reference](#) PHP String Reference](#) ## Example Calculate the soundex key for "Hello": [Run Example Β»](#) * * * ## Definition and Usage The soundex() function calculates the soundex key of a string. The soundex key is a 4-character alphanumeric string that represents the English pronunciation of a word. The soundex() function can be used in spelling check programs. **Note:** The soundex() function creates the same key for words with similar pronunciations. **Tip:** The [metaphone()](#) function is more accurate than the soundex() function, as metaphone() understands the basic rules of English pronunciation. * * * ## Syntax soundex(_string_) | Parameter | Description | | --- | --- | | _string_ | Required. Specifies the string to check. | ## Technical Details | Return Value: | Returns the soundex key of the string if successful, FALSE if failure. | | :--- | | PHP Version: | 4+ | * * * ## More Examples ## Example 1 Use the soundex() function on two words with similar pronunciation: <?php $str = "Assistance"; $str2 = "Assistants"; echo soundex($str); echo "
"; echo soundex($str2); ?> [Run Example Β»](#) * * PHP String Reference](#)
← Func String SprintfFunc String Localeconv β†’