Just a little quirk I've come accross and I think I must be missing something so would like some clarification to further my understanding of what's going on with my code.
I post a form via jQuery AJAX, the form is processed by PHP and in the PHP I have the line
return $status;
$status is an array containing several values i.e $status['username'] = 'admin'
The AJAX datatype is set to 'JSON' but I am not using echo json_encode($status);
in my PHP but everything is still working and my $status array is processed by jQuery upon AJAX success. Why is this? I thought json_encode would be required but it seems it isn't.
json_encode
when trying to parse it with javascript – self Feb 17 '13 at 17:55$status
– self Feb 17 '13 at 17:56