I am working with user supplied dimensions on a variety of products. Users supplied the length, width and height, but to calculate shipping costs I have take the longest measurement and set it as length and add that to the girth, which is calculated by adding the two shorter measurements and multiplying them by 2.
$PackageSize = length + (width*2 + height*2)
I can find which value is the highest using:
$newlength=max($length, $width, $height);
I can't figure out how to then figure out which are the two remaining values so I can plug them into the right place in the equation.