我认为这是一个愚蠢的问题,但我在 php 上找不到它。为什么下面的代码中++=:
function calculateRanking()
{
$created = $this->getCreated();
$diff = $this->getTimeDifference($created, date('F d, Y h:i:s A'));
$time = $diff['days'] * 24;
$time += $diff['hours'];
$time += ($diff['minutes'] / 60);
$time += (($diff['seconds'] / 60)/60);
$base = $time + 2;
$this->ranking = ($this->points - 1) / pow($base, 1.5);
$this->save();
}
是说 $time 具有所有这些值,还是将所有值添加到 $time 中?
Thanks
它将所有这些值添加到时间中。
something += somethingelse
是一个快捷方式
something = something + somethingelse
-Adam
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)