force json_encode not to put quotes
Posted: Wed Feb 10, 2010 6:17 am
Hello.
I need to force json_encode NOT to put any quotes around certain values.
Example:
json_encode returns:
and $(this).val() doesn't get executed by javascript when I publish this result on a page.
Is it possible to tell json_encode not to enclose some values with quotes?
Like when it doesn't do that for integers.
Thank you!
I need to force json_encode NOT to put any quotes around certain values.
Example:
Code: Select all
$ar = array(
'data' => '$(this).val()'
);
Code: Select all
{"data":"$(this).val()"}
Is it possible to tell json_encode not to enclose some values with quotes?
Like when it doesn't do that for integers.
Thank you!