我有這樣的代碼:PHP邏輯運算符IF語句
if (($oldTime < (time() - self::wait))) {
if ($this->setTime())
{
return true;
}
else
{
return false;
}
} else {
return false;
}
我可以將其替換爲:
if (($oTime < (time() - self::wait)) && $this->setTime()) {
return true;
} else {
return false;
}
我需要它來檢查,如果$this->setTime()
返回true僅當$oTime < (time() - self::wait)
是真實的。
是的,你可以,這是一樣的。 – dfsq 2013-03-12 19:56:56
* Offtopic *老兄,我們擁有相同的頭像......尊重我的權威! :-D – Quasdunk 2013-03-12 20:04:58
@Quasdunk哈哈) – rinchik 2013-03-12 20:13:32