伙计们,我现在需要你的帮助。我的问题是如何在array_combine中获取键的值?我想根据定量得到装运费的价值,例如
这是我的结构,请帮助我,如果它真的错了。
$quant = 3;
$x = $quant- 1;
$z =$quant ;
$shipment_fee = $this->Model_checkout->get_shipment($shop_item_sk);
foreach($shipment_fee as $key)
{
$ship_fee = explode('^',$key->shop_item_ship_price); //ex. 1^3
$ship_num = explode('^',$key->shop_item_ship_num); //ex. 100^250
}
$shipment = array_combine($ship_num,$ship_fee);
$shipment_fees = '';
for($y=$x;$y<$z;$y++)
{
$shipment_fees = $shipment[$y];
/*line 47 */ echo $shipment_fees; //The value must be 250
}
问题是我得到了值但是第47行有一个错误。未定义的偏移量:2。先谢谢你们。