128
rated 0 times
[
129]
[
1]
/ answers: 1 / hits: 29828
/ 15 Years ago, mon, november 16, 2009, 12:00:00
I need to encode a javascript function into a JSON object in PHP.
This:
$function = function(){};
$message = Hello;
$json = array(
'message' => $message,
'func' => $function
);
echo json_encode($json);
outputs:
{message:Hello,func:function(){}}
What I want is:
{message:Hello,func:function(){}}
Can I do this with json_encode?
More From » php