I am working with json in Codeigniter and i have some fields which outputs null values i want to change those null values to empty string. I don't want to check every fields one by one.My CI code is like this:
$result= $this->get_model->get_model();
header("content-type: application/json");
$data[] = array('name'=>"result",'data'=>$result);
echo json_encode(array('success'=> 1,'posts'=>$data));
return $result;
null
with empty stringecho json_encode(array('success'=> 1,'posts'=>$data));
this line prints.