stripos returns false when special characters is used

后端 未结 4 1620
名媛妹妹
名媛妹妹 2020-12-07 02:14

I am using the stripos function to check if a string is located inside another string, ignoring any cases.

Here is the problem:

stripos(\"ø\", \"Ø\")         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-07 02:49

    Use mb_stripos() instead. It's character set aware and will handle multi-byte character sets. stripos() is a holdover from the good old days when there was only ASCII and all chars were only 1 byte.

提交回复
热议问题