English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP soundex() Function Usage and Example

    PHP String Manual of String Functions

    The soundex() function is used to calculate the soundex key of a string.

Syntax

string soundex ( string $str )

Definition and Usage

Used to calculate the soundex key of a string.

The soundex key is 4 A alphanumeric string of characters, representing 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 pronunciation.

Tip: metaphone() More accurate than the soundex() function because metaphone() understands the basic pronunciation rules of English.

Return Value

It returns the soundex key in string form

Parameter

Serial NumberParameter and Description
1

string

Enter String

Online Example

Try the following example, calculate the string oldtoolbag.com's Soundex key:

<?php
   //Calculate the string oldtoolbag.com's Soundex key.
   $input = "oldtoolbag.com";
   echo soundex($input);
?>
Test and see‹/›

Output Result

N250

PHP String Manual of String Functions