foreach($array as $sub)
{
$temp = getCloseBy($sub[1],$sub[0]);
foreach($temp as $sub2)
{
$temp2 = getCloseBy($sub2[1],$sub2[0]);
foreach($temp2 as $sub3)
{
$temp3 = getCloseBy($sub3[1],$sub3[0]);
foreach($temp3 as $sub4)
{
$temp4 = getCloseBy($sub4[1],$sub4[0]);
foreach($temp4 as $sub5)
{
$temp5 = getCloseBy($sub5[1],$sub5[0]);
foreach($temp4 as $sub6)
{
$temp6 = getCloseBy($sub6[1],$sub6[0]);
foreach($temp4 as $sub7)
{
$tot[] = $sub7;
}
$tot[] = $sub6;
}
$tot[] = $sub5;
}
$tot[] = $sub4;
}
$tot[] = $sub3;
}
$tot[] = $sub2;
}
$tot[] = $sub;
}
First I need to point out the code it self works just as fine.
The thing is I'm having trouble making it dynamic, as in like in a single loop. After a couple of hours of trying myself I know turn to you.:rolleyes: