PHP soundex() Function


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

Syntax
soundex(string)
Parameters
  • String - (Required) Specify the string to be check.
Example
<?php
    $a = "Welcome";
    echo soundex($a);
?>

Output

W425
soundex() function on two similar sounding words:
<?php
    $a = "allot";
    $b = "a lot";

    echo soundex($a);
    echo "<br>";
    echo soundex($b);
?>  

Output

A430
A430

Prev Next