Javascript Object to a PHP Object

Published: 15 January 2010
on channel: optikalefx
27,184
95

I show you a function I made that lets you use your javascript object as a php object. Basically it takes your JS object and turns into a JSON string that PHP decodes. The key to making this work is stripping strings once you json_decode, because it addes slashes when it goes through post.

The other key, is to take into account indexed arrays, that way if a property of a JS object is an array, it will still be an array when it gets to PHP.


On this page of the site you can watch the video online Javascript Object to a PHP Object with a duration of hours minute second in good quality, which was uploaded by the user optikalefx 15 January 2010, share the link with friends and acquaintances, this video has already been watched 27,184 times on youtube and it was liked by 95 viewers. Enjoy your viewing!