Php html_实体_解码切割codeigniter输出
我将PHP(5.2.13)与IIS6和CodeIgniter框架一起使用,并使用html_实体_解码处理来自数据库的打印数据问题。例如:Php html_实体_解码切割codeigniter输出,php,codeigniter,html-entities,Php,Codeigniter,Html Entities,我将PHP(5.2.13)与IIS6和CodeIgniter框架一起使用,并使用html_实体_解码处理来自数据库的打印数据问题。例如: <?php echo html_entity_decode($somedata,ENT_QUOTES,"UTF-8"); echo "Hello"; ?> 请尝试使用此帮助程序,可以找到更多信息 我刚找到这个 - * In some versions of PHP the native function does not work - * w
<?php
echo html_entity_decode($somedata,ENT_QUOTES,"UTF-8");
echo "Hello";
?>
请尝试使用此帮助程序,可以找到更多信息 我刚找到这个
- * In some versions of PHP the native function does not work
- * when UTF-8 is the specified character set, so this gives us
- * a work-around. More info here:
- * http://bugs.php.net/bug.php?id=25670
- *
- * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the
- * character set, and the PHP developers said they were not back porting the
- * fix to versions other than PHP 5.x.
CI中的解决方法应该是加载安全库并像这样使用它
$this->load->library('security');
return $this->security->entity_decode($str, $charset);
您是否在视图内部调用
html\u entity\u decode()
?我在控制器和视图上都进行了尝试,得到了相同的结果。我知道html\u entity\u decode()
的作用,但请编辑问题并提供$somedata
,其中包含什么?请在换行后阅读。sql驱动程序是odbc。
//example from the site
$string="Joe's \"dinner\"";
$string=quotes_to_entities($string); //results in "Joe's "dinner""
- * In some versions of PHP the native function does not work
- * when UTF-8 is the specified character set, so this gives us
- * a work-around. More info here:
- * http://bugs.php.net/bug.php?id=25670
- *
- * NOTE: html_entity_decode() has a bug in some PHP versions when UTF-8 is the
- * character set, and the PHP developers said they were not back porting the
- * fix to versions other than PHP 5.x.
$this->load->library('security');
return $this->security->entity_decode($str, $charset);