05-09-2008, 10:33 AM
|
#1 (permalink)
|
|
The Wanderer
Join Date: May 2008
Posts: 5
Thanks: 3
|
Undefined variables issues
Help !
What am I missing here ??
I have the following:
PHP Code:
class Test
{
var $var1;
function Set($var1)
{
$this->$var1 = $var1;
}
function Show()
{
echo $this->$var1;
}
}
$Test = new Test();
$Var = 1;
$Test->Set($Var);
$Test->Show()
and I get a Undefined Variable var1 ... cannot access empty property .... error message for the line
$this->$var1 = $var1;
Any ideas anyone .... thanks in advance
JabberGabber
|
|
|
|