You may have a large JSON object made of an array of objects, like in the example below: Looping through an object of objects with foreach() The easiest way of accessing all the data is decoding the object as an associative array.Įcho "First Name: ".$data."" Įcho "Email Address: ".$data."" In the above example, the " address" has an object as its value while " siblings" has an array value comprising of objects. Accessing data in a nested JSON objectĪ JSON object may comprise of json objects and arrays as the values in its name-value pairs such as in the example below: You access the data as in any other PHP associative array as in the example below:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |