strcasecmp() function operates like strcmp(), except that its comparison is case insensitive. : strcasecmp « String « PHP






strcasecmp() function operates like strcmp(), except that its comparison is case insensitive.

 
Its syntax is: int strcasecmp (string string1, string string2)

<?
$string1 = "butter";
$string2 = "Butter";
if ((strcasecmp($string1, $string2)) == 0) :
     print "Strings are equivalent!";
endif;
?>
  
  








Related examples in the same category

1.Comparing strings case-insensitively
2.Using strcasecmp to compare two strings
3.int strcasecmp ( string str1, string str2 ) is a case-insensitive version of the strcmp( ) .