Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/295.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php html_实体_解码切割codeigniter输出_Php_Codeigniter_Html Entities - Fatal编程技术网

Php html_实体_解码切割codeigniter输出

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(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
- * 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&#39;s &quot;dinner&quot;"
- * 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);