php iter throught object code example Example: php loop through class properties foreach ($obj as $key => $value) { echo "$key => $value\n"; }