<?php
include('head.php');
$arr = array (41, 5, 26, 2, 88, 9, 38, 67, 14, 30, 25, 44, 11, 94, 58);
sort($arr); // Sortera för att skriva ut kombinationerna i storleksordning
$x = 0;
while ($x < count($arr)){ // Loopa igenom arrayen
$y = $x + 1; // Testa alla tal efter position $x
while ($y < count($arr)){
$z = $y + 1; // Testa alla tal efter position $y
while ($z < count($arr)){
if ($arr[$x] + $arr[$y] + $arr[$z] == 97){ // Summan 97?
echo $arr[$x] . ' + ' .$arr[$y] . ' + ' . $arr[$z] .' = 97<br>';
}
$z++;
}
$y++;
}
$x++;
}
include('foot.php');
?>