Execute this sample and see for yourself:
<?
$Pn = array();
$Pn[0][1] = 30;
$Pn[0][0] = "This is number 30";
$Pn[1][1] = 20;
$Pn[1][0] = "This is number 20";
$Pn[2][1] = 50;
$Pn[2][0] = "This is number 50";
$Pn[3][1] = 35;
$Pn[3][0] = "This is number 35";
sort($Pn);
for($i=0;$i<1;$i++){
for($n=0;$n<4;$n++){
echo $Pn[$n][$i]."<BR>";
}
}
$Pn2 = array();
$Pn2[0][0] = 30;
$Pn2[0][1] = "This is number 30";
$Pn2[1][0] = 20;
$Pn2[1][1] = "This is number 20";
$Pn2[2][0] = 50;
$Pn2[2][1] = "This is number 50";
$Pn2[3][0] = 35;
$Pn2[3][1] = "This is number 35";
sort($Pn2);
for($i=0;$i<1;$i++){
for($n=0;$n<4;$n++){
echo $Pn2[$n][$i]."<BR>";
}
}
?>
It looks like sort() orders the array based on the [$i][0] index, not by [$i][1] or else. Maybe this is what you're looking for...
Hope this helps
fLIPIS