arrays in classes?
Posted: Wed Mar 31, 2004 3:29 pm
well what i wanna ask is this:
Code: Select all
<?php
class foo {
var $var = array();
function addelement($elm) {
$this->var[] = $elm;
}
}
can we do something like that?
i want to add an array as a var in class and add elements to it in a function.
thanks.
?>