note 105873 added to function.is-object
| From: | mark at not4you dot com | Date: | Wed, 21 Sep 2011 19:22:52 +0000 |
| Subject: | note 105873 added to function.is-object | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-183336@lists.php.net to get a copy of this message | ||
<?php
/**
* Unserializes data as returned by the standard PHP serialize() function.
* If the unserialized object is not an array, it will be converted to one,
* particularily useful if it returns a __PHP_Incomplete_Class.
*
* @param string $data Serialized data
*
* @return array Unserialized array
*/
function unserialize2array($data) {
$obj = unserialize($data);
if(is_array($obj)) return $obj;
$arr = array();
foreach($obj as $k=>$v) {
$arr[$k] = $v;
}
unset($arr['__PHP_Incomplete_Class_Name']);
return $arr;
}
----
Server IP: 216.235.13.26
Probable Submitter: 96.53.64.82
----
Manual Page -- http://www.php.net/manual/en/function.is-object.php
Edit -- https://master.php.net/note/edit/105873
Del: integrated -- https://master.php.net/note/delete/105873/integrated
Del: useless -- https://master.php.net/note/delete/105873/useless
Del: bad code -- https://master.php.net/note/delete/105873/bad+code
Del: spam -- https://master.php.net/note/delete/105873/spam
Del: non-english -- https://master.php.net/note/delete/105873/non-english
Del: in docs -- https://master.php.net/note/delete/105873/in+docs
Del: other reasons-- https://master.php.net/note/delete/105873
Reject -- https://master.php.net/note/reject/105873
Search -- https://master.php.net/manage/user-notes.php