Is == in PHP a case-sensitive string comparison?

后端 未结 7 1110
孤独总比滥情好
孤独总比滥情好 2020-12-13 11:56

I was unable to find this on php.net. Is the double equal sign (==) case sensitive when used to compare strings in PHP?

7条回答
  •  借酒劲吻你
    2020-12-13 12:31

    You could try comparing with a hash function instead

      if( md5('string1') == md5('string2') ) {
        // strings are equal
      }else {
        // strings are not equal
      }
    

提交回复
热议问题