Tag : json_decode

JSON Decode PHP

The json_decode() function is used to decode or convert a JSON object to a PHP object. Example: $jsonobj = ‘{“Peter”:35,”Ben”:37,”Joe”:43}’; $obj = json_decode($jsonobj); echo $obj->Peter; echo $obj->Ben; echo $obj->Joe;

How To Get List Array PHP Json

Sample data JSON: <php $get_url='{ “countries”: [ { “name”: “United States of America”, “code”: “US”, “city”: “New York” }, { “name”: “India”, “code”: “IN”, “city”: “New Delhi” }, { “name”: “China”, “code”: “CN”, […]