Make encoding uniform before comparing strings in PHP

后端 未结 6 1544
攒了一身酷
攒了一身酷 2021-01-20 16:21

I\'m working on a feature which requires me to get the contents of a webpage, then check to see if certain text is present in that page. It\'s a backlink checking tool.

6条回答
  •  一个人的身影
    2021-01-20 16:42

    Without application code it's difficult to say what's happening.

    Try using trim() on the strings to remove trailing whitespace, which is invisible to the naked eye.

    You may find strcmp gives better results as well.

提交回复
热议问题