PHP removes backslashes in JSON string and backslash before double quotation mark, JSON double quotation mark
The JSON string that is passed to PHP via Ajax is sometimes added with a backslash "\" to escape, and PHP needs to be stripped of the backslash before Json_decode.
ps:php get fetch JSON how to remove backslash before double quotation mark
This is not the standard JSON format data, you can first "replace".
Then use the Json_decode () system function to convert it to a JSON object, if you want to convert to an array plus the second argument is true.
If the output is still null due to the existence of the BOM header information,
Copy the Code code as follows:
$arr = Json_decode (Trim ($json, Chr (239). chr (187). Chr (191)), true);
Conversion.
This article is all finished, and I hope you will be helpful in using PHP to remove the backslash in the JSON string and to remove the backslash before the double quotation mark.
http://www.bkjia.com/PHPjc/1058158.html www.bkjia.com true http://www.bkjia.com/PHPjc/1058158.html techarticle PHP removes the backslash in the JSON string and the backslash before the double quotation mark, and JSON double quotes through Ajax to PHP JSON string sometimes with a backslash "\" to escape, PHP processing needs ...