Hello,
How can I declare an array as a class variable? For example I can do:
<?php
class test {
private $name = 'john';
public function getName() {
return $this->name;
}
}
?>
But how can I make the following work?
<?php
class test {
private $name = array();
private $name[] = 'john';
private $name[] = 'jenny';
public function getName() {
return $this->name;
}
}
?>