I saw some sample php scripts can use a function after one another, but I can't find how to write script like that.
When I write the php script:
class apple {
function banana() {
echo 'Hi!';
}
}
It looks like this when I want to call the function banana
:
$apple = new apple;
$apple->banana();
What if I want to call a function right after the previous one, like this:
$apple->banana()->orange()
I've tried to put an function inside another, but it returns with error. How can I write the script like this?