for each prop of object php code example Example: php loop through object foreach ($obj as $key => $value) { echo "$value\n"; }