Use one function to call another
Posted: Thu Apr 20, 2006 4:16 pm
I have a quick question, if I have a function can i use it to call other functions outside of itself?
Example
this way when the function Day() is called, it will activate and execute the other functions. Is that possible or does the I want to be called have to be inside the function I am already using?
Example
Code: Select all
class DailyActivities{
var $something;
var $somethingelse;
function Day($whichday){
$this->something = gotoWork();
$this->somethingelse = gotoSchool();
}
function gotowork(){
return $var;
}
function gotoSchool(){
return $anothervar;
}
}this way when the function Day() is called, it will activate and execute the other functions. Is that possible or does the I want to be called have to be inside the function I am already using?