The soundex() function is a built-in function in PHP and is used to calculate the Soundex key of a given string.
The soudex key is a four character long alphanumeric string(starting with a letter) which represents the English pronunciation of the given string.
Parameters: This function accepts a single parameter $str which represents the string for which we want to find the Soundex key.
Return Value: It returns the soundex key as a string.
Below programs illustrate the soundex() function in PHP:
Program 1: In the below program, the soudex() function generates the soundex key of the string “geeksforgeeks”.
Program 2: In the below program, we will see that two words having same pronunciation produce similar Soundex key.
- How to get the function name inside a function in PHP ?
- p5.js | pan() Function
- p5.js | log() function
- D3.js | d3.map.set() Function
- CSS | hsl() Function
- p5.js | cos() function
- CSS | url() Function
- PHP | pow( ) Function
- p5.js | max() function
- p5.js | arc() Function
- PHP | pi( ) Function
- p5.js | min() function
- CSS | var() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.