and> the comparison operator in php will compare the first character of your string, and then compare the other characters that follow in the strings. Thus, your first expression ai (first line) and I (second line) a is the first character in the line compared to i as the first character in the second line s> will return false, and then the second statement will return true because the same reason. However, if you really need to compare two longer string values ββwith many characters, you can try using the substr_compare method:
substr_compare("abcde", "bc", 1, 2);
in this example, you need to compare two lines, 1 is the start position of the offset, and 2 is the number of characters you want to compare to the right of these lines. -1 means the beginning of the offset from the end of the first line. for example do something like this:
substr_compare("string1", "string2", 0, length);
also consider using strcmp () as well, for example strcmp ("string1", "string2", length), where length is the number of characters you want to compare with two strings.
Morufu salawu
source share