I'm having troubles with creating an array within a class. There's no problem doing it elsewhere, it's just inside a class.
I start off by making the class
Code: Select all
class Name {I then declare a few variables,
Code: Select all
var $something;Code: Select all
function name() {
$this->array = array(1 => 'a','b','c');
echo $this->array[1];
}Code: Select all
}Code: Select all
echo "test";If anyone can point out what i'm doing wrong, it'd be greatly appreciated.
I've checked the manual, google'd it -> What am I missing???
Thanks.