欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

html_entity_decode有关问题

程序员文章站 2023-12-30 23:52:46
...
html_entity_decode问题
require_once("../config.inc.php"); # config
require_once("../connDB.php");
require_once($pathClassLib."/function.common.php");

$rs = $conn->Execute("Select * from `Aboutus` limit 1");

if (!$rs) print $conn->ErrorMsg(); else print "OK!";

print $rs->fields["profile_c"];

?>


。。。。。。

=html_entity_decode($rs->fields["profile_c"])?>


这段代码中 上面的print可以正确打印出 profile_c的内容,可是到了下面的html中显示的确是 “fields["profile_c"])?>”。请问各位高手是什么问题啊

------解决方案--------------------
请确认你电脑上的php版本大于4.3.0,html_entity_decode这个函数是php4.3.0才引入的
------解决方案--------------------
你试试用手册上的这个函数试试
PHP code
function unhtmlentities($string) 
        {
            $trans_tbl = get_html_translation_table(HTML_ENTITIES);
            $trans_tbl = array_flip($trans_tbl);
            return strtr($string, $trans_tbl);
        }

------解决方案--------------------
你需要启用短写方式,即 php.ini 中
short_open_tag = on

html_entity_decode有关问题

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频


上一篇:

下一篇: