A whole grip of work was needlessly done here because the author wasn't aware of the Soundex, which PHP even has a native string function for:
http://www.php.net/manual/en/function.soundex.phpInteresting to see the way the author attacks a problem entirely out of his element, but as with anything, a little research ahead of time goes a long way.