I've just started looking at OO PHP and was wondering how you would access an object in a script other than the one that instantiated it.
For example:
<?php // file: animal.php
Class Animal
{
$name;
$noise;
function _construct($nm, $no)
{
$this->name = $nm;
$this->noise = $no;
}
function noise()
{
return $this->$noise;
}
}
$dog = new Animal("dog", "Woof!");
?>
How could i access the $dog object in a different script?
Any help would be much appreciated.