I have this example:
class test_names {
public name = 'ralph';
function dispname() {
return $this->name;
}
}
$test = new test_names;
$test->name = 'John';
$test->dispname;
now the result will be "John" because I saved that in de public var
Now I have another file called test2.php and I do this:
$test = new test_names;
$test->dispname;
the result will be "ralph" but I don't want that, I want it to be "John" (that value I've set before)
How can I make this happen?