PHP program to decode the JSON string into a multi-dimensional array

bookmark

<?php
//PHP program to decode the Json string into 
//multi-dimensional array.
$json = '[[101,"Amit",5000],[102,"Rahul",7000],[103,"Rohit",8000]]';
$emps = json_decode($json);

for ($i = 0;$i < 3;$i++)
{
    for ($j = 0;$j < 3;$j++)
    {
        print ($emps[$i][$j] . "  ");
    }
    echo "<br/>";
}
?>


Output
101 Amit 5000
102 Rahul 7000
103 Rohit 8000