ok so i ran a test which seems to work on the first index of the array:
<?
$myArray['windows 95']['test1']['yes'] = 25;
$myArray['windows 95']['test1']['no'] = 0;
$myArray['windows 98']['test1']['yes'] = 20;
$myArray['windows 98']['test1']['no'] = 5;
$myArray['windows 2000']['test1']['yes'] = 15;
$myArray['windows 2000']['test1']['no'] = 10;
$myArray['windows XP']['test1']['yes'] = 10;
$myArray['windows XP']['test1']['no'] = 15;
$myArray['Mac X']['test1']['yes'] = 10;
$myArray['Mac X']['test1']['no'] = 15;
$myArray['Mac 9']['test1']['yes'] = 5;
$myArray['Mac 9']['test1']['no'] = 20;
ksort($myArray, SORT_STRING);
reset($myArray);
echo "<html><body>";
foreach($myArray as $OS=>$os_data) {
foreach($os_data as $TEST=>$test_data) {
foreach($test_data as $key=>$value) {
echo $OS . ".";
echo $TEST . ".";
echo $key . "=" . $value . "<BR>";
}
}
}
echo "</body></html>";
?>
the output looks like this:
Mac 9.test1.yes=5
Mac 9.test1.no=20
Mac X.test1.yes=10
Mac X.test1.no=15
windows 2000.test1.yes=15
windows 2000.test1.no=10
windows 95.test1.yes=25
windows 95.test1.no=0
windows 98.test1.yes=20
windows 98.test1.no=5
windows XP.test1.yes=10
windows XP.test1.no=15
Problem: the sort puts all UPPERCASE items before all LOWERCASE items. in other words 'ZZZOUNDS' gets sorted before 'aaron'
Can anyone recommend a way to sort by the 2nd index of the array while still preserving the data relations?