I have a json array:
[
{
"var1": "9",
"var2": "16",
"var3": "16"
},
{
"var1": "8",
"var2": "15",
"var3": "15"
}
]
How can I loop through this array using php?
|
Some versions of php require a 2nd paramter of true if you require an associative array
|
|||||||||
|
Decode the JSON string using
|
||||
|
Use
|
||||
|
First you have to decode your json :
Then after the json decoded you have to do the foreach
If you want something specific just ask for a key like this. Put this between the last foreach.
|
||||
|