Re: short type codes for use in array conversion

From: Date: Fri, 26 Aug 2005 05:22:20 +0000
Subject: Re: short type codes for use in array conversion
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-221397@lists.php.net to get a copy of this message
Ken Tozier wrote:
I found a method for converting javascript arrays to PHP arrays here: "http://aspn.activestate.com/ASPN/Cookbook/PHP/Recipe/414334" and would like to expand the list of types the function knows about. It looks like 's' = string, 'a' = array but 'i' for integer and 'n' for number don't work. Is there a list of type codes somewhere on the php site? I did a search but apparently didn't hit upon the correct phrase as all searches came up with zero results.
The JS code is creating a string in the same way that serialize() does, so that it can be passed through unserialize() to get the actual array. There isn't really a description (that I could find, anyway) in the PHP manual of how serialize() actually stores its values. Take a look at "PHP's Serialization Format", about 1/3 of the way down on this page: http://hurring.com/code/perl/serialize/ Jasper

« previous php.general (#221397) next »