G
Gary Mayor
Hi,
I'm trying to get an array into order i've got this array,
$number[1] = "5";
$number[2] = "7";
$number[3] = "4";
$number[4] = "8";
$number[5] = "7";
i'm trying to get it into another array it looks like this,
$number2[1] = "8";
$number2[2] = "7";
$number2[3] = "7";
$number2[4] = "5";
$number2[5] = "4";
So far i've got some code like this,
for($i=1;$i<=$count;$i++) {
for($ii=1;$ii<=$count;$ii++) {
if ($number[$ii]>=$highest[$i]) {
$number2 = $number[$i];
print "\n$number2[$i]";
}
}
}
I've tried the pseudo but could figure out the logic. This is the first
time i've had to do ordering of this sort so i'm a bit stuck at which
way to go next. I've checked out cpan but couldn't find anything that
looked like it would do what i wanted.
Has anyone got any ideas please.
Thanks
Gary
I'm trying to get an array into order i've got this array,
$number[1] = "5";
$number[2] = "7";
$number[3] = "4";
$number[4] = "8";
$number[5] = "7";
i'm trying to get it into another array it looks like this,
$number2[1] = "8";
$number2[2] = "7";
$number2[3] = "7";
$number2[4] = "5";
$number2[5] = "4";
So far i've got some code like this,
for($i=1;$i<=$count;$i++) {
for($ii=1;$ii<=$count;$ii++) {
if ($number[$ii]>=$highest[$i]) {
$number2 = $number[$i];
print "\n$number2[$i]";
}
}
}
I've tried the pseudo but could figure out the logic. This is the first
time i've had to do ordering of this sort so i'm a bit stuck at which
way to go next. I've checked out cpan but couldn't find anything that
looked like it would do what i wanted.
Has anyone got any ideas please.
Thanks
Gary