I am sending a HTTP request to a Server and get a response with json format. I convert it to array using:
$response = file_get_contents($final_url);
$responseArray = json_decode($response, true);
Here is server response array($responseArray
).
Array (
[status] => OK
[result] => Array (
[0] => Array
(
[trainno] => 12151
[name] => SAMARSATA EXP
[cls] => 1A 2A 3A SL
[rundays] => F,Sa
[from] => BQA
[fromname] => Bankura
[dep] => 03.45
[to] => HWH
[toname] => Howrah Jn
[arr] => 08.25
[pantry] => 0
[type] => SUPERFAST
[datefrom] => 10-Apr-2015
[dateto] => 12-Apr-2020
[traveltime] => 04.40
)
[1] => Array
(
[trainno] => 12151
[name] => SAMARSATA EXP
[cls] => 1A 2A 3A SL
[rundays] => F,Sa
[from] => BQA
[fromname] => Bankura
[dep] => 03.45
[to] => HWH
[toname] => Howrah Jn
[arr] => 08.25
[pantry] => 0
[type] => SUPERFAST
[datefrom] => 10-Apr-2015
[dateto] => 12-Apr-2020
[traveltime] => 04.40
)
)
)
Now I want to print 'result' array in html table format if [status] =>OK. How I can do it?