Re: serialize() function

From: Date: Fri, 14 Apr 2006 00:56:11 +0000
Subject: Re: serialize() function
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-233973@lists.php.net to get a copy of this message
There's nothing special about the data returned by serialize() except that it can be safely written saved, transmitted, etc. To do anything useful with it you have to unserialize() it. The cool part about it is that you can serialize any data structure, like an entire array or object. The Yahoo Developer center (ever friendly to PHP developers) talks about how their APIs can return serialized data for PHP: http://developer.yahoo.com/common/phpserial.html For example, use can use the Yahoo Search API to search for "Seinfeld", unserialize the results, and have a beautiful array to use: print_r(unserialize(file_get_contents("http://api.search.yahoo.com/WebSearchService/V1/webSearch?appid=YahooDemo&query=Seinfeld&results=3&output=php"))); (It's almost like making SOAP out of a REST call.) Richard On Apr 13, 2006, at 3:53 PM, Nicholas Couloute wrote:
Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ~Nick Couloute co-owner/Web Designer Sidekick2Music.Com


« previous php.general (#233973) next »