Computer >> Computer tutorials >  >> Programming >> PHP

soundex() function in PHP


The soundex() function in PHP is used to calculate the soundex key of string. The key is a four character long alphanumeric string representing English pronunciation of a word.

Syntax

soundex()

Parameters

  • NA

Return

The soundex() function returns the soundex key as a string.

Example

The following is an example −

<?php
   $res = "Welcome"; 
   echo soundex($res);
?>

Output

W425