okey so here is my structure.
one.php two.php three.php
one.php includes both two.php and three.php
two.php is
class two {
function test(){ $var ='gello'; }}
three.php is
class three {
function testt(){ $var ='hello'; }}
So how could i use the $var variable of two.php in three.php ?
in one.php i can do that by
$one = new two();
$one->var;
any help would be appreciated.
Thanks
You need to define variable outiside the function
When you write inside function, only the function know who are
$varand show te correct value.