public function returnAuthor()
{
return $author;
}
public function anotherMethod()
{
return $this->returnAuthor();
}
You could follow a similar method as stated in the above example.
or you could define a property for your class, have one function assign a value to it and have another function return the value
Like so
class Book
{
public $author;
function __construct()
{
$this->author = 'Sir Conan Doyle';
}
function anotherMethod()
{
return $this->author;
}
}
Hope this helps!