Looping through all of a PHP objects properties is just as easy as an array.
$obj = new stdClass(); $obj->name = 'mike'; $obj->car = true; $obj->location = 'texas'; foreach ($obj as $key=>$value) { echo "$key=>$value\n"; }
Output:
name => mike car => 1 location => texas