Home >Backend Development >PHP Tutorial >html_entity_decode有关问题

html_entity_decode有关问题

WBOY
WBOYOriginal
2016-06-13 10:01:39812browse

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);        }<br><font color="#e78608">------解决方案--------------------</font><br>你需要启用短写方式,即 php.ini 中<br>short_open_tag = on<br><br><div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn