<?php
$jarr = json_decode('[{"var1":"11","var2":"12","var3":"13"},{"var1":"21","var2":"22","var3":"23","var4":"24"}]', true);
// The true parameter enables associative use of keys
foreach($jarr as $item) { // foreach element in $arr
echo "var1 = ".$item["var1"],"<br>"; // Show the value of var1
}
echo "<hr>";
for ($i=0; $i<sizeof($jarr);$i++) { // for every element in the array
foreach($jarr[$i] as $key => $val) { // for every key - value in the object
echo ($key." - ".$val."<br>");
}
echo "<hr>";
}
?>