• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

html_entity_decode有关问题

php 搞代码 4年前 (2022-01-25) 9次浏览 已收录 0个评论

html_entity_decode问题
<?php
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 $co2本文来源gaodaima#com搞(代@码$网6

搞gaodaima代码

nn->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


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:html_entity_decode有关问题

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址