PHP condition with IF working incorrect

This question already has an answer here:

  • How do I check if a string contains a specific word? 37 answers

  • your code is returning a 0 when evaluating the string position for the file "phpminiadmin.php" and thus "==" interprets that as FALSE.

    As an example try using the filename, "aphpminiadmin.php". Your code will then work correctly because strpos returns a 1 which is clearly not false.

    Thus, the change that MonkeyZeus suggests will fix the issue.

    MonkeyZeus - hope you don't mind my piggybacking on your answer. 'Just thought the example more clearly illustrated the problem.

    链接地址: http://www.djcxy.com/p/13140.html

    上一篇: 检查在PHP的HTML文字

    下一篇: 中频工作的PHP条件不正确