$nexttime = strtotime($mining->last_payout+X_MINUTES); $nowtime = time(); $lefttime = $nexttime - $nowtime;