I'm sure I can find this on PHP.net if I knew what to look for!
Basically I am trying to iterate over all public variables from a class.
To simplify:
<?PHP class Person { public $name = 'Fred'; public $email = ' fred@example.com '; private $password = 'sexylady'; public function __construct() { foreach ($this as $key=>$val) { echo "$key is $val \n"; } } } $fred = new Person;
The name and address of Fred should just be displayed ....
source share