php iterate thru object code example Example: php iterate thru object foreach ($obj as $key => $value) { echo "$key => $value\n"; }