PHP から MySQL 读取データベース出力乱数
MySQL の如く図示:



PHP 文件如下:
header("Content-Type: text/html; charset=utf-8") ;
$index = 0;
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("test", $con);
mysql_query("set names 'utf8'");
mysql_query("setcharacter_set_client=utf8");
mysql_query("setcharacter_set_results=utf8");
$result = mysql_query("SELECT * FROM test_list
limit 0,4");
while($row = mysql_fetch_array($result))
{
$load_crouse_array[$index] = array(
'Subject_ID' => $row['Subject_ID'],
'Subject_title' => $row['Subject_title'],
'Subject_url' = > $row['Subject_url'],
'Subject_belong' => $row['Subject_belong'],
'Creat_time' => $row['Creat_time']
) > $index ;
}
mysql_query("INSERT INTO `test`.`test_list` (`Subject_ID`, `Subject_title`, `Subject_url`, `Subject_belong`, `Creat_time`) VALUES ('100005', '测试文本', 'test_url', 'excel_crous', '2014-08-10');");
echo json_encode($load_crouse_array);
echo "test Chinese 测试中文";
?>
最後図に示すような結果が出力されます。

同時に入力されたデータ ブロック内の中国語部分も、???? と表示されます。この問題はメモ帳にもあります。環境は Windows 7、XMAPP、chrome ブラウザを使用しています。
------解決策----- ----
これはランダムコードではなく、json で保護されており、出力時に閲覧されるべき文は再解釈されています。

------解読方式--------------------
この $load_crouse_array の数グループは、json_encode 処理を通過した後のデータであり、乱コードではなく、中国語で Unicode 処理されます。 出力print_r($load_crouse_array);これは乱コードであるかどうかを知ります。