note 5711 modified in function.serialize by aidan
| From: | aidan@php.net | Date: | Thu, 24 Jun 2004 10:20:16 +0000 |
| Subject: | note 5711 modified in function.serialize by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71580@lists.php.net to get a copy of this message | ||
About serialize/unserialize on objects:
Use this class to unserialize objects :
<?php
class Unserializable
{
function unserialize($str)
{
$ary=unserialize($str);
for(reset($ary);$kv=each($ary);)
{
$key=$kv[key];
if (gettype($this->$key)!="user function")
$this->$key=$kv[value];
}
}
}
?>
--was--
About serialize/unserialize on objects:
Use this class to unserialize objects :
class Unserializable
{
function unserialize($str)
{
$ary=unserialize($str);
for(reset($ary);$kv=each($ary);)
{
$key=$kv[key];
if (gettype($this->$key)!="user function")
$this->$key=$kv[value];
}
}
}
http://php.net/manual/en/function.serialize.php