I hava script with both $this keyword and without it. Each one does the same thing.
I cant understand what does $this do.
this with $this
class Time {
var $sTime;
function GenerateCurrentTime(){
$this->sTime = gmdate("d-m-Y H:i:s");
return $this->sTime;
}
function ShowFutureDate($iAddDays=0){
$this->sTime = gmdate("d-m-Y H:i:s", strtotime("+" . $iAddDays . " days"));
return $this->sTime;
}
}
and this is without $this version
class Time {
var $sTime;
function GenerateCurrentTime(){
$sTime = gmdate("d-m-Y H:i:s");
return $sTime;
}
function ShowFutureDate($iAddDays=0){
$sTime = gmdate("d-m-Y H:i:s", strtotime("+" . $iAddDays . " days"));
return $sTime;
}
}
Thanks in advance for attention