I have a json encoded data stored in my database. I want to convert this json encoded data to array for specific purpose. I have used json_decode function but it seems not working because I got errors. How can I get back to array structure the data I have saved in my database in json format? Please help. Here is my code. Thanks a lot.
Controller function
function show_at_report(){
$data = $this->data;
$report_id = $this->uri->segment(3);
$at_id = $this->uri->segment(4);
$query = $this->core_model->get_report_details($report_id,$at_id);
$a = $query['rows'];
var_dump($a);
foreach($a as $b){
var_dump($b);
}
}
Output:

Modified Controller function
function show_at_report(){
$data = $this->data;
$report_id = $this->uri->segment(3);
$at_id = $this->uri->segment(4);
$query = $this->core_model->get_report_details($report_id,$at_id);
$a = $query['rows'];
json_decode($a,TRUE);
var_dump($a);
foreach($a as $b){
json_decode($b,TRUE);
var_dump($b);
}
}
Output showing errors

What is the problem with this? How can I get the json data back to array?
$aand apply thejson_decodeto each row in the loop.var_dump($a)orprint_r($a)to see what is in it.