I tried array_reverse but it seems to only reverse the elements and not the keys. I'm tryinig to print my array in reverse order by key. Below is my code.$_SESSION['sql_history_id']) contains a numeric key with an array for it's element.
if (is_array($_SESSION['sql_history_id'])){
foreach($_SESSION['sql_history_id'] as $key=>$value){
$SQL = $key;
if (is_array($value)) {
foreach($value as $key=>$value){
$CURRENT_SQL = ($_SESSION['current_history_id']==$SQL) ? "<img border='0' title = \"Current\" src='".DIR_WS_IMAGES."arrow.gif' >" : "";
echo "<li><a href=\"".FILENAME_INDEX."?SQL=$SQL\">$CURRENT_SQL $key </a></li>";
}
}
}
}