PHP数组求和问题 30
想求商品1+商品2的总价怎么写额。。。。foreach($itemsas$i=>$item){if($i>$itemnum)break;if($nodata){if($_...
想求商品1+商品2的总价 怎么写额。。。。
foreach($items as $i=> $item ) { if($i > $itemnum ) break; if($nodata) { if ($_MODULE['mode']==2){ $yx="../../assets/images/310/img_$i.jpg"; } $itemPicUrl = "$yx"; $itemUrl = "#"; $itemTitle = "商品未选择,请选择商品,图片标题都是自动读取,方便简单"; $itemPrice = "2214.00"; $discountPrice = "1831.00"; $itemSoldCount = "1588"; $itemcollectedCount = "2311" } else { $itemUrl = $uriManager->detailURI($item); $itemPicUrl = $item->getPicUrl($img_size); $itemTitle = $item->title; $itemPrice = $item->price; $discountPrice = number_format($item->discountPrice,2); $itemSoldCount = $item->soldCount; $itemId = $item->id; $itemcollectedCount = $item->collectedCount; } 展开
foreach($items as $i=> $item ) { if($i > $itemnum ) break; if($nodata) { if ($_MODULE['mode']==2){ $yx="../../assets/images/310/img_$i.jpg"; } $itemPicUrl = "$yx"; $itemUrl = "#"; $itemTitle = "商品未选择,请选择商品,图片标题都是自动读取,方便简单"; $itemPrice = "2214.00"; $discountPrice = "1831.00"; $itemSoldCount = "1588"; $itemcollectedCount = "2311" } else { $itemUrl = $uriManager->detailURI($item); $itemPicUrl = $item->getPicUrl($img_size); $itemTitle = $item->title; $itemPrice = $item->price; $discountPrice = number_format($item->discountPrice,2); $itemSoldCount = $item->soldCount; $itemId = $item->id; $itemcollectedCount = $item->collectedCount; } 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询