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