Im building a shipping calculator for fedex which is working fine when i need to ship one item, but sometimes i need to ship multiple items.
code:
$xyz=calcShip(30,4,4,2.5);
foreach ($xyz as $sType => $tCost){
print $sType ." ". $tCost . "<br>";
}
the print looks like this:
Priority Overnight 32.49
Standard Overnight 60.38
2 Day 28.58
Express Saver 22.08
Ground 8.35
but if i want to calculate multiple shipments one after another and the shipment types are always those 5 in the same order, how can i just add all of the prices together for each type?
1 Answer