PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
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?
Functions can call other functions. Methods can call other methods and functions. The code you posted would be a method to method call. When calling another method of the same class $this-> should be used if you want to refer to the current (active) instance of the class (i.e. object)