have been trying to pass a PHP array to a JavaScript array, but when I read out the content of that JavaScript array it shows literally [object, object].
if($error!='') {
$this->output
->set_content_type('application/json')
->set_output(json_encode(array(
'message' => array(
array(
'status'=>'error',
'message'=> $error1
),
array(
'status'=>'error',
'message'=> $error2
)
)
)));
}
$error1='Size Title Required !';
$error2='Size Code Required !';
I have been trying to pass a PHP array to a JavaScript array, but when I read out the content of that JavaScript array it shows literally [object, object].