开发者

javascript alternative to php seralize

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜