我有一个浏览器显示解码html实体的问题。 我试图显示来自WordPress博客的博客描述。文本在被保存在数据库之前被编码为html实体。因此,为了显示超链接,文本必须是html实体解码的,所以a-tag被正确渲染。html_entity_decode不解码
但是,当我尝试解码文本它仍然作为html实体出来。
被解码之前的输出:
echo(bloginfo('description')); //output: Display a hyper link. <a href="">READ MORE</a>
当被解码的输出。这是我的问题。它仍然没有解码!检查输出。
echo(html_entity_decode(bloginfo('description'))); //output: Display a hyper link. <a href="">READ MORE</a>
而当我尝试硬编码要解码的文本,它的工作原理!
echo(html_entity_decode('Display a hyper link. <a href="">READ MORE</a>')); //output: Display a hyper link. <a href="">READ MORE</a>
我看了一下php手册,并尝试了不同的字符集和引用样式作为参数。但仍然没有运气。
我做错了什么,有什么想法?
关闭当然! Tack Emil! – Tjofras 2011-04-07 09:04:25