What I have is an array that has several values
Array
(
[result] => 1
[message] => Query Successful
[data] => Query Output
[0] => Array
(
[QNO] => 1
[SNAME] => test1
[QDESC] => testing
)
[1] => Array
(
[QNO] => 2
[SNAME] => test2
[QDESC] => testing
)
and so on with more data. I want to be able to extract that in my php script. The data shown was from printing the decoded array with
$data = json_decode($json, true);
I can print everything with print_r() but I want to be able to print using a loop so I can create a table with it.
To try an output of all the question numbers I tried a rough for loop using
for($i = 0; $i <=5; i++){
$Qnum = $data[$i]['QNO'];
echo $Qnum[$i];
$i++;
}
but this seems to just keep loading and loading the script with no output. The print_r($data) prints everything out as shown above.
Still fairly new to php/json stuff.