卡住strip_tags为什么不能在我的代码中工作?
问题描述:
我想从以下字符串中删除引号和HTML标签:卡住strip_tags为什么不能在我的代码中工作?
$mystring='Example string "I want to remove any html tags ABC<sub>DE</sub> from <p>similar</p> types of string?"';
我使用下面的脚本来删除它,但它是对我不起作用:
echo strip_tags(htmlentities($mystring,ENT_QUOTES));
我想下面的输出对于上面的字符串:
Example string "I want to remove any html tags ABCDE from similar types of string?"
为什么strip不起作用?我在这里弄到了什么?
答
在第一次使用如果你想删除HTML标签,然后使用ヶ辆如下它应该是工作用strip_tags功能:
echo htmlentities(strip_tags($mystring),ENT_QUOTES);
答
您可以使用此代码
echo strip_tags($mystring);
我必须从字符串中脱离单引号或双引号以及条形标记。该脚本正常工作。谢谢 – ThoHua