<o:p> </o:p>&lt; o:p> &安培; nbsp; &LT; / o:p&gt;显示错误

时间:2009-12-23 10:12:34

标签: php mysql outlook tags

每当我收到来自MS Outlook的电子邮件时,我都会收到此标签&lt; o:p> &安培; nbsp; &LT; / o:p&gt; (没有空格)显示为?在&lt;&gt;。

浏览器页面字符集编码是UTF-8,当我将其更改为ISO-8859-1时,符号消失但我的其他字符出错。我必须使用UTF-8

如何删除此标记序列。

PHP语言。将这些混乱存储在mysql中。

1 个答案:

答案 0 :(得分:0)

如果要删除PHP中的内容,可以使用str_replace

$string = "<o:p>&nbsp;</o:p> and rest of string";
$searchedstring = "<o:p>&nbsp;</o:p>";
$string = str_replace($searchedstring,"",$string);
echo $string; (Output will be " and rest of string")

在这种情况下,您只需将搜索到的字符串替换为空,但也可以是其他内容。