Hi,
The problem i'm having may be related to the version of PHP i'm using.
I have an object
The problem is $this->$t[] = $d; It isn't adding it to the relevant array.PHP Code:foo {
private $var1 = array();
private $var2 = array();
function foobar($t , $d){
$this->$t[] = $d;
}
}
EG. when $t = 'var2', $this->$t[] should add a value to the $var2 array. But it's not doing that unless I hardcode the varible name.
All the variables that are to be used are hardcoded in the object, none of the variables are to be created on the fly.
Doing this on another local machine (at home) works fine, but on my work machine, the setting of a variable using $this->$t[] does not work.
Is there an extension I could be missing?
Or... am i being a total idiot?
Cheers.



Reply With Quote

Bookmarks