JSON data is created by nested key-value pairs where the value can be a number, string, Boolean, null, object. The example code will return as associative array. dataObject jsondecode (jsonData) // Dump all data of the Object printr (dataObject) // Access object data echo dataObject 0->name We need to pass second Boolean parameter true if want output as array data. I can't figure out how to access "name" nested inside "image" so I can get market_square_clifden.jpg. JSON is quite similar in structure to PHP arrays. The below example code will convert json string to object. I have spent hours at this and I've read loads of answers here on stackoverflow and none have helped.Īll I've been able to do so far is to print Market Square - Clifden for this example.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |