note 37187 added to function.get-object-vars
| From: | jordi at laigu dot net | Date: | Thu, 06 Nov 2003 10:21:57 +0000 |
| Subject: | note 37187 added to function.get-object-vars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-59978@lists.php.net to get a copy of this message | ||
In case your object contains again OBJECTS or ARRAYS:
function makeAssoc($res) {
if (is_object($res)) $res = get_object_vars($res);
while (list($key, $value) = each($res)) {
if (is_object($value) || is_array($value)) {
$res[$key] = makeAssoc($value);
}
}
return $res;
}
Thanks to mark at dreamzpace dot com
----
Manual Page -- http://www.php.net/manual/en/function.get-object-vars.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37187
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37187&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37187&report=yes
Search -- http://master.php.net/manage/user-notes.php