note 108060 modified in function.unserialize by danbrown
| From: | danbrown@php.net | Date: | Tue, 27 Mar 2012 16:15:02 +0000 |
| Subject: | note 108060 modified in function.unserialize by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-186871@lists.php.net to get a copy of this message | ||
woohah!
--was--
I used Google-Oauth for authentication, got a "Person-Object" back and saved this
in the database (serialized).
After unserializing, i got the PHP_INCOMPLETE-Class, because the Person-Class was not included.
To avoid this i converted the original-class to a PHP stdClass via Json:
<?php
// Before: $me_data == Person()
$me_data = json_encode($me_data);
$me_data = json_decode($me_data);
// After: $me_data == stdClass()
?>
http://php.net/manual/en/function.unserialize.php