-3
我的共享虚拟主机将\添加到JSON。我使用ExtJS的,它通常发送该数据PHP将添加到JSON
[{"property":"id","direction":"ASC"}]
Howere PHP接收或chages它作为[{\"property\":\"id\",\"direction\":\"ASC\"}]
因此我不能使用json_decode($_REQUEST['sort'])
我想这是因为他们想防止SQL注入,但现在他们打破了我的申请。我必须做什么?
编辑:
$sort = json_decode($_GET['sort']);
print_r($_GET); // [sort] => [{\"property\":\"id\",\"direction\":\"ASC\"}]
print_r($sort); //
也许这个功能可以帮助您? http://am.php.net/manual/en/function.stripslashes.php – gaskar 2013-02-24 18:41:53