In the development of the project due to the introduction of the batch record array, due to many fields, so it is impossible to &a=322&=gsd&v=rwe in the ordinary way to transmit, so thought of the front-handed JSON format in the past content=[{' a ': 2321 , ' B ': ' GSD ', ' C ': ' Dww '},{' a ': ' 4sd ', ' B ': ' Gsd2 ', ' C ': ' DWW3 '},.....] , so many records background parsing is also very convenient, but when I did this, backstage received the [{\ ' a\ ': 2321,\ ' b\ ': \ ' gsd\ ', \ ' c\ ': \ ' dww\ '} ...] such a format, and I need the standard JSON format string, The use of PHP Json_decode parse directly into the array, so I would be good operation, online search a lot of students also encountered and I have the same problem, looking for a half-day best still did not find the answer, finally or their own whole out, stripslashes with PHP in this function, It's OK to convert the captured JSON string.
In fact, this problem is caused by the GET_MAGIC_QUOTES_GPC () function, if the configuration in php.ini is off should not be the problem, so use this function when added to the judgment
$json for the received JSON string
if (GET_MAGIC_QUOTES_GPC () ==1) {
$json = stripslashes ($json);
}
Needless to say, two years did not complete PHP, have forgotten, the recent project needs to go over the manual