jquery – json stringify to php

jquery – json stringify to php

If you are not using dataType : json, you might need to do stripslashes

$.post(window.data.baseUrl, {posts : JSON.stringify(posts)});

And in php:

$posts = json_decode(stripslashes($_POST[posts]));

This helped me:

 data = json_decode($this->request->data[jsarr], true);

in your php code for accessing the record

Hope it will help someone!

jquery – json stringify to php

Im going to take a guess and say that you SHOULDNT stringify anything. I believe JQuery will do that for you. Namely, no person = JSON.stringify(person). Give that a try.

Leave a Reply

Your email address will not be published. Required fields are marked *