I'm having a complete brainfart right now and can't seem to remember this. Tried looking it up in the manual, but couldn't find an example. Here's what I have:
class myclass {
function testA {
}
function testB {
}
}
So that's my basic setup. I want to define a variable. I then want to set it's value in testA(). I then want to be able to access the value in testB(). Where and how do I define this variable?
I thought all I had to do was something like:
class myclass {
public $tempvar='';
function testA {
$tempvar="my new value";
}
function testB {
echo $tempvar;
}
}
But this says that $tempvar is equal to NULL. What am I forgetting? Thanks in advance!