Hi, I'm sure I could find this on PHP.net if only I knew what to search for!
Basically I'm trying to loop through all public variables from within a class.
To simplify things:
<?PHP
class Person
{
public $name = 'Fred';
public $email = '[email protected]';
private $password = 'sexylady';
public function __construct()
{
foreach ($this as $key=>$val)
{
echo "$key is $val \n";
}
}
}
$fred = new Person;
Should just display Fred's name and email....