1. Go to this page and download the library: Download iliaal/phonetic library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// Build a phonetic index, then look up by shared code
$index = [];
foreach ($records as $id => $name) {
foreach (dm_soundex($name) as $code) {
// Skip the dual-purpose "000000" sentinel (unencodable *and* pure vowels).
if ($code === "000000") {
continue;
}
$index[$code][] = $id;
}
}
// Query every code in the set (not only [0]): branching names like Auerbach
// share a secondary code with Oerback that the first code alone would miss.
$hits = [];
foreach (dm_soundex("Moskovitz") as $code) {
if ($code === "000000") {
continue;
}
foreach ($index[$code] ?? [] as $id) {
$hits[$id] = true;
}
}
$hits = array_keys($hits);
// Splitting a BMPM token string into its individual codes. Prefixed names emit
// grouped output with parentheses (e.g. bmpm("van Smith") => "(zmit)-(...)"), so
// split on '(', ')', '|' and '-' -- the same separators bmpm_match() tokenizes on.
$codes = preg_split('/[()|-]+/', bmpm("van Smith"), -1, PREG_SPLIT_NO_EMPTY);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.