Source Code:
(back to article)
<?php $object = new stdClass(); $object->name = 'John'; $object->age = 30; $object->city = 'New York'; $properties = get_object_vars($object); foreach ($properties as $property => $value) { echo $property . ': ' . $value . PHP_EOL; }
Result:
Report an issue