The strcmp() function compares two strings and returns an integer accordingly.
Syntax: strmp(string1,string2);
This function returns 0 if both the strings are equal.
It returns a value less than zero, if string1 is less than string2.
It returns an integer greater than zero if string1 is greater than string2.
Example input:
$str1 = "Hello";
$str2 = "Halo";
echo strcmp($str1,$str2);
Example output:
1
No comments:
Post a Comment