每当我收到来自MS outlook的电子邮件时,我都会收到这个标记& nbsp;(不带空格),哪个显示为?在<>中。
浏览器页面字符集编码为UTF-8,当我将其更改为ISO-8859-1时,符号消失,但其他字符出错。我必须使用UTF-8
如何删除此标记序列。
PHP语言。在mysql中存储乱七八糟的东西。
发布于 2011-02-12 18:01:19
如果你想在PHP中删除一些东西,你可以使用str_replace
$string = "<o:p> </o:p> and rest of string";
$searchedstring = "<o:p> </o:p>";
$string = str_replace($searchedstring,"",$string);
echo $string; (Output will be " and rest of string")在这种情况下,您只需将搜索到的字符串替换为空,但它也可以是其他内容。
https://stackoverflow.com/questions/1951879
复制相似问题