How can I pass a json from php to jquery with null values. I have the structure below:
$data1 = null; $data2 = null; $data3 = null;
json_encode(array(
'html'=>$html,
'data1'=>$data1,
'data2'=>$data2,
'data3'=>$data3)
);
Passing null gives an error:
Uncaught SyntaxError: Unexpected token < in JSON at position 0
PHP usage 5.5.12