我有:
if($this->itemCount <= 11 ) {
$item['subtotal'] = 12.95 * $item['qty'];
$item['price'] = 12.95;
$this->update_item($item['id'], $item['qty'], $item['price']);
}
但是我需要一个“和”运算符来检查它是否也等于或大于2.
if($this->itemCount <= 11 && => 2 )
我不知道如何在PHP中执行此操作。 :(
答案 0 :(得分:5)
if($this->itemCount <= 11 && $this->itemCount >= 2) {
// Your code here
}
答案 1 :(得分:2)
if($this->itemCount <= 11 && $this->itemCount >= 2 )
答案 2 :(得分:2)
if($this->itemCount <= 11 && $this->itemCount => 2 )
答案 3 :(得分:0)
你只需要写出完整的表达式:
if($this->itemCount <= 11 && $this->itemCount >= 2 )