[eluser]Michal1[/eluser]
Hey guys I would like to ask about an usage of variables in class.
Lets say I have a class "site". in this class I have two functions, first is index and second is "test".
in index function I have then this
Code:
function index()
{
$example = 'blablabla';
}
and now I want to use this same variable in function and use for example echo on this. So I have:
Code:
function test()
{
echo $example;
}
But when I do this I receive an error: Undefined variable: example
So my question is what do I need to do to have a variable which can I use through the whole class?
Thank you