This article mainly introduces the php json data parsing example, a very important application. if you need it, you can refer to this article to demonstrate the php json data parsing method in the form of an example, this is a more practical feature and will be shared with you for your reference. The code is as follows:
<? Php $ data; $ data. = "["; for ($ I = 0; $ I <20; $ I ++) {$ data. = "{"; $ data. = "\" id \":\"". 110. "\", "; $ data. = "\" name \":\"". 110. "\", "; $ data. = "\" original_price \":\"". 110. "\", "; $ data. = "\" sale_price \":\"". 110. "\", "; $ data. = "\" introduce \":\"". 110. "\", "; $ data. = "\" content \":\"". 110. "\", "; $ data. = "\" nums \":". 110. ""; $ data. = "}"; if ($ I <19) {$ data. = "," ;}}$ data. = "]"; // Before resolution $ Data is in json format $ array = array (); $ de_json = json_decode ($ data, true); // var_dump ($ de_json ); $ count_json = count ($ de_json); for ($ I = 0; $ I <$ count_json; $ I ++) {$ array [$ I] ["id"] = $ de_json [$ I] ['id']; $ array [$ I] ["name"] = $ de_json [$ I] ['name']; $ array [$ I] ["original_price"] = $ de_json [$ I] ['original _ price']; $ array [$ I] ["sale_price"] = json_encode ($ de_json [$ I] ['sale _ price']);} var_dump ($ array);?>
If you are interested, you can debug the example in this article. I believe there will be new gains.