int strcmp(string $string1, string $string2)

int stricmp(string $string1, string $string2)

int strncmp(string $string1, string $string2, int $length)

int strnicmp(string $string1, string $string2, int $length)

These functions compare two strings and return a comparison value. The function returns a value of zero, less than zero, or greater than zero if $string1 is equal to, less than, or greater than $string2, respectively.

strcmp() and strncmp() perform a case-sensitive compare

stricmp() and strnicmp() perform a case-insensitive compare

Functions with a $length parameter only compare up to the first $length characters.