【发布时间】:2012-01-25 19:13:23
【问题描述】:
我正在研究这样的功能:
function foo() {
return '[ = ]';
}
但这会返回:
[@]
我需要:
[ = ]
有什么想法吗?
【问题讨论】:
-
return htmlentities('[ = ]'); -
这工作正常,但现在如何实现休息(
)? :) -
返回?还是输出@?浏览器会自动转换。
-
我猜这是帖子的一部分,或者是 WP 的东西,你需要正则表达式,才能像你想要的那样显示。发布更多信息/内容。
-
不要使用
htmlentities(),因为它会返回一些浏览器无法处理的实体。请改用htmlspecialchars(),并确保您的页面编码正确。
标签: php function return special-characters