note 44872 deleted from function.serialize by tomsommer

From: Date: Wed, 18 Aug 2004 19:30:42 +0000
Subject: note 44872 deleted from function.serialize by tomsommer
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74907@lists.php.net to get a copy of this message
Note Submitter: ---- Function in javascript to serialize an array javascript to PHP serialized array: function serialize (data) { if (typeof(data) == 'object') { str_data = 'a:' + data.length + ':{'; for (var i = 0; i < data.length; i++) { str_data += 'i:' + i + ';' + serialize(data[i]); } return str_data + '}'; } else { if (data.length == 0) { str_data = 'N;'; } else { str_data = 's:' + data.length + ':"' + data + '";'; } return str_data; } } Jonas Goes msl@goes.eti.br http://www.goes.eti.br

« previous php.notes (#74907) next »