PHP Strcmp() Function Performs Case-Sensitive Comparison Of Two Strings. – String Function

 
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;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.