I am new to JSON and I have a rather basic question….
Here is an example of JSON that is a response from a PHP page. My intention is to have two JSON objects, Photos, and Comments. Unfortunately, my JSON is flawed and it is not formatted properly. I do not know how to structure the JSON so that I can get both objects. What should this look like, if the JSON were correct for two objects? In other words, what do I need between Photos and Comments to indicate that these are two different objects?:
{"Photos": [ {"Filename": "5962230079803.jpg", "PhotoID": "39"}] "Comments": [ {"UserID": "100000660901552", "Comment": "Hello!"}]}
Add a comma between each element:
If you’re defining and parsing this JSON result, and storing it in variable
obj, access the properties using: