Hi

I have a very simple array of 3 values, width, height and length.

```
$girth_array=array("$length", "$width", "$height");
```

I need to get the 2 smallest sides and add them together…then multiply by 2 and add the longest side.

I can sort the array from smallest to largest.

```
sort($girth_array);
foreach ($girth_array as $key => $val) {
echo "AHA[" . $key . "] = " . $val . "\
";
}
```

which outputs for example

```
AHA[0] = 80 AHA[1] = 90 AHA[2] = 100
```

So I know I need add keys [0] and [1] together…then multiply by 2. And then add [2].

But how to do that?

Many thanks