note 25189 added to function.get-object-vars
| From: | mark at dreamzpace dot com | Date: | Fri, 13 Sep 2002 15:44:53 +0000 |
| Subject: | note 25189 added to function.get-object-vars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36636@lists.php.net to get a copy of this message | ||
In case your object contains again objects (and so on), this function might be useful:
function makeAssoc($res) {
$res = get_object_vars($res);
while (list($key, $value) = each($res)) {
if (is_object($value)) {
$res[$key] = makeAssoc($value);
}
}
return $res;
}
--
http://www.php.net/manual/en/function.get-object-vars.php
http://master.php.net/manage/user-notes.php?action=edit+25189
http://master.php.net/manage/user-notes.php?action=delete+25189
http://master.php.net/manage/user-notes.php?action=reject+25189