Yaz's Blog

I am a php developer. I am a geek. I am a fiction reader. A movie and tv addict.
An XBOX360 player. A snowboarder. A cyclist. A Softball player. A Venezuelan-Canadian.

[tech] json_encode returns quoted strings!

I didn’t know this, but the php function json_encode() actually adds quotes to any string you encode.

I was submitting some values with Ajax.InPlaceEditor, and in the php side encoding my return string with json_encode. Well, it was returning “value”, and adding it in the div. But the value inserted in the database was not quoted.

I thought it was the Ajax.InPlaceEditor. A frustrating thing to not know.

Blog comments powered by Disqus