PHP string comparison won't match seemingly identical string

后端 未结 3 1524
梦毁少年i
梦毁少年i 2021-01-16 01:25

I am scraping the DOM of a static site with PHP and pulling out specific bit\'s of data so I can put stuff into a database.

For this example I am storing the inner H

3条回答
  •  暖寄归人
    2021-01-16 02:13

    You should as question why this one happens

    string(45) "Description"
    string(11) "Description"
    

    Second one is 11 chars, first one is 45! Why? So there are some hidden (not showed) characters\symbols. That's why this strings not equal.

    Try this one Remove control characters from php String

提交回复
热议问题