0
我正试图在数组内找到一个值。计算两个数组之间的值
我的功能:
$discount_quantity = $Products->getProductsDiscountQuantity($products_id)
回本:
[0] => string(1) "1" [1] => string(1) "5" [2] => string(2) "10"
我有例如$qty = 6
数量,我需要对
if $qty < 5 then $discount = 0%
if $qty > 5 et qty < 10 then $discount = 10%
if $qty > 10 then $discount = 15%
应用的折扣如何使一个数组?
是$ discount_quantity一个像[0] => string(1)“1”[1] => string(1)“5”[2] => string(2)“10”的数组? –
是的,如果我理解你的问题 – kurama