- get_defined_functions: documentation ( source)
- array_merge: documentation ( source)
- str_replace: documentation ( source)
- metaphone: documentation ( source)
<?php
$funcs = get_defined_functions();
$funcs = array_merge($funcs['user'], $funcs['internal']);
$shortest = 0;
$closest = '';
$find = metaphone('pretty');
foreach ($funcs as $func) {
$func = str_replace('_', ' ', $func);
if (metaphone($func) === $find) {
echo "Found $func";
break;
}
}
echo 'Found ', $closest ? $closest : 'none';