strcmp() function performs a case-sensitive comparison of two strings.
Its syntax follows: int strcmp (string string1, string string2)
strcmp() returns one of three possible values:
0 if string1 and string2 are equal
< 0 if string1 is less than string2
> 0 if string2 is less than string1
<?
$string1 = "butter";
$string2 = "butter";
if ((strcmp($string1, $string2)) == 0) :
print "Strings are equivalent!";
endif;
?>
Related examples in the same category