$obj = new obj();
serialize($obj);
$j=unserialize($obj);
print_r($j);
$j=unserialize($obj);
print_r($j);
class obj {
public $id='';
public $name='';
public $desc='';
public $user='';
function __toString(){
return serialize($this);
}
}
class obj {
public $id='';
public $name='';
public $desc='';
public $user='';
function __toString(){
return json_encode((array)$this);
}
}