0

Question:

    
    if ("sometext" == "SOMEtext") {
        echo "TRUE";
    } else {
        echo "FALSE";
    }
    

It is return me FALSE, when I use double equal.
The only diference are the capital leters...
This if should return TRUE ????

  • 1
    String comparisons are case sensitive. Your assumption is incorrect. Check out this question for a solution: https://stackoverflow.com/questions/5473542/case-insensitive-string-comparison – Brad Dec 05 '21 at 21:35
  • `==` will only change the type if the two operands of that operator are not of the same type, but in your case both operands are a string. When comparing the two strings here, the "s" character is a different character than "S", just like it is different to "š" or whatever variant you try. This means that both strings are not equal to each other. – Sumurai8 Dec 05 '21 at 21:38

1 Answers1

0

You can use strtolower("somestring") in order to compare 2 strings without account for case sensitivity

THE_CHOODICK
  • 125
  • 6