hello I have a javascript array and 开发者_运维问答I would like to use a function for javascript that will take my array and serialize it.
Thanks
The best (native) way to serialize objects in Javascript is JSON; newer browsers support JSON natively, for other browsers a script can be included: https://github.com/douglascrockford/JSON-js
On the PHP side, there is json_decode function that can be used to deserialize JSON.
The native PHP function has been ported to Javascript as well in the php.js library:
http://phpjs.org/functions/serialize:508
精彩评论