最佳答案
How can I loop through all the properties of object?. Right now I have to write a new code line to print each property of object
echo $obj->name;
echo $obj->age;
Can I loop through all the properties of an object using foreach loop or any loop?
Something like this
foreach ($obj as $property => $value)