How can I set a global variable in this class? I have tried this:
class myClass
{
$test = "The Test Worked!";
function example()
{
echo $test;
}
function example2()
{
echo $test." again";
}
}
Which failed to load the page completely citing a 500 error. Next I tried this one:
class myClass
{
public $test = "The Test Worked!";
function example()
{
echo $test;
}
function example2()
{
echo $test." again";
}
}
But when I printed both of these, all I see is " again" Sorry for such a simple question!
Thanks!