我有 2 个字符串,当我var_dump()看到一个字符串比另一个字符串长 5 个字符时。
我想这是因为在第一个字符串中,'(引号)被视为'
或'(但我不确定)。
string(15) "i'm a bird"
string(10) "i'm a bird"
我希望第一个字符串也有 10 个字符。
我已经尝试过htmlspecialchars(), htmlspecialchars()with ENT_QUOTES, htmlspecialchars()with ENT_NOQUOTES, utf8_decode(), utf8_encode(), ...
它仍然是一个string(15).
有人知道怎么做吗?
编辑:@Mathieu Imbert:当我查看页面源代码时,我看到它是这样的:
string(15) "i'm a bird"
解决方案:
编辑:谢谢 PeeHaa !你代码@http ://codepad.viper-7.com/pvHCwH修好了!
html_entity_decode($title, ENT_QUOTES);