- array_push: documentation ( source)
<?php
class Foo {
private $_foo = array();
public function fill(){
array_push($this->_foo, "hello");
array_push($this->_foo, "world");
}
public function getFoo() {
return $this->_foo;
}
}
$foo = new Foo();
foreach($foo->getFoo() as $q){
echo $q;
}