Example 1 — Get a Soundex Key
Two names that sound alike share a key.
<?php
echo soundex("Robert"), PHP_EOL;
echo soundex("Rupert"), PHP_EOL; How It Works
- Pass a name. The first letter stays as the prefix.
- Letters become digits. Similar sounds get the same digit.
- Pass a second name. It sounds close to the first.
- Compare keys. Both print
R163.

