【发布时间】:2010-11-12 18:51:53
【问题描述】:
我有一个包含国际字符字符串的数组。
当我将其保存在数据库中时,我松开了反斜杠?为什么?
$descr_arr = array("héééllo","world");
$js_encoded = json_encode($descr_arr);
print $js_encoded; // "[\"h\u00e9\u00e9\u00e9llo\",\"world\"]"
$sql_query = "UPDATE test_table SET description = '$js_encoded' WHERE id = 0";
$sql_res = mysql_query($sql_query);
// in the description field in the database I find:
// ["hu00e9u00e9u00e9llo","world"]
【问题讨论】: