为什么html_entity_decode不起作用?

时间:2015-07-12 07:10:44

标签: php decode decoding

我在尝试解码数据库列中的html时遇到了很多麻烦。我表中的每一列都有可能包含需要解码的内容。例如,//是需要解码的许多内容之一。我在php上很糟糕。我的代码不做解码。请帮忙。

<?php   
        $connection = mysql_connect($host, $user, $pass);

        if(!$connection)
        {
            die("Database server connection failed.");  
        }
        else
        {
            $dbconnect = mysql_select_db($db, $connection);

            if(!$dbconnect)
            {
                die("Unable to connect to the specified database!");
            }
            else
            {
                $query = "SELECT * FROM Table WHERE area='ON'";

                $resultset = mysql_query($query, $connection);

                $records = array();

                while($r = mysql_fetch_assoc($resultset))
                {
                    $records[] = $r;        
                }


                mysqli_close($connection);
                json_encode($records);
                echo html_entity_decode($records);
            }   
        }
?>

0 个答案:

没有答案
相关问题