Scusa ma la funzione strcmp? non va bene?

http://php.net/manual/en/function.strcmp.php