It looks to me like the change in $qty alternates between 3 and 5. If this is generally true (that is, it's true for quantities larger than 25,) then you can use something like:
if ( ( ($qty + 1) % 8 ) < 3 ) {
they ordered 0,1,2 or
(8 * y) + 0, 1, or 2 for
some y
$total = $bottleweight * $qty + $shipweight[floor($qty/8)];
} else {
they ordered 3,4,5,6,7 or
(8 * y) + 3,4,5,6, or 7 for
some y
$total = $bottleweight * $qty + $shipweight[floor($qty/8)+1];
}
I suspect, though, that $shipweight[] varies with packaging in the following way- you can either put the bottles in a 2 pack, or in a 6 pack. Every 2 pack weighs $twopack and every 6 pack weighs $sixpack. In that case, what you really want to do is maximize the number of 6 packs you use with the proviso that you will use a 2 pack for 1 or 2 bottles.
If that's the case, you want something like:
$total = $bottleweight $qty;
$total += floor($qty/6) $sixpack;
$total += ($qty % 6) < 3?$twopack:$sixpack;
I think that says, $total starts as the weight of all of the bottles, then $total gets the number of six packs times the weight of a sixpack added, then if there are one or two bottles $total gets a $twopack's weight, otherwise it gets a $sixpack's weight added.
-- Matt