views:

81

answers:

1

I'm making a PHP model to store a serialized array in a database. The array is then accessed via AJAX through an HTTP request.

Is there a JavaScript function to serialize and unserialize arrays like PHP?

EDIT: This is the php function http://uk.php.net/manual/en/function.serialize.php

+3  A: 

You meant “serialize”? jQuery’s $.ajax & $.json methods would automatically serialize JavaScript objects for you, and in modern browsers you can use JSON.stringify directly.

Evadne Wu
There is also a json library provided by Douglas Crockford at http://www.json.org/js.html
Ryan Kinal