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


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to