Want to parse JSON object array using PHP, but I don't know how to do it as I am new to PHP.
Here is my JSON (Structure can't be altered since the JSON is constructed by other system):
[
{
"animalName":"Fox",
"animalId":"1"
},
{
"animalName":"Elephant",
"animalId":"2"
},
{
"animalName":"Monkey",
"animalId":"3"
},
{
"animalName":"Donkey",
"animalId":"4"
}
]
I used json_decode function to decode it but I dont know how to read values inside the json.
For ex: How would I get the value Monkey by parsing the JSON.
Thanks in advance for your help!