-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