可能重复:
How to wipe html special chars like and others from text with the help of PHP?
我有这个字符串:
6:30
如何删除
?爆炸无效。
答案 0 :(得分:4)
应该与
一起使用trim(html_entity_decode($s))
答案 1 :(得分:3)
$string = " 6:30";
$string = str_replace(" ","",$string);
echo $string;
或
$string = " 6:30";
$string = trim($string);
echo $string;