php – html_entity_decode代替?也?如果没有怎么替换呢?
发布时间:2020-12-13 14:06:57 所属栏目:PHP教程 来源:网络整理
导读:我有一种情况,我把一个字符串传递给一个函数.我想转换 nbsp;到“”(空格),然后再传递给函数. html_entity_decode是吗? 如果不行怎么办? 我知道str_replace,但还有其他出路吗? 报价从 html_entity_decode() 手册: You might wonder why trim(html_entity_
我有一种情况,我把一个字符串传递给一个函数.我想转换& nbsp;到“”(空格),然后再传递给函数. html_entity_decode是吗?
如果不行怎么办? 我知道str_replace,但还有其他出路吗?
报价从
html_entity_decode() 手册:
您可以使用 <?php $a = html_entity_decode('> <'); echo 'before ' . $a . PHP_EOL; $a = str_replace("xA0",' ',$a); echo ' after ' . $a . PHP_EOL; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |