Change JS to PHP

Changed the Javascript search for a PHP one.