tonelm54
asked on
sub/child functions
Is it possible to create sub/child functions in PHP?
For example:-
Im trying to stucture my code a bit better and would like to try and group some code in 'sections', and seen in other languages something similar like:-
I know in PHP, it would be something like:-
Basically this is more of a question, more than a requiment......
Thanks in advance.
For example:-
class car() {
function drive() {
function left($deg) {
}
function right($deg) {
}
}
}
Im trying to stucture my code a bit better and would like to try and group some code in 'sections', and seen in other languages something similar like:-
car.drive.left(45);
I know in PHP, it would be something like:-
$myCar = new car();
$myCar.drive.left(45);
Basically this is more of a question, more than a requiment......
Thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://php.net/manual/en/language.oop5.php