How can I sort an array, so that instead of
aaron
james
mike
Brian
Dan
I would get
aaron
Brian
Dan
james
mike
I tried sort($arrayname) but that doesn't work. I also tried natsort($arrayname) but that didn't work either.
Exact code is simple:
$names[0]=aaron;
$names[1]=mike;
$names[2]=Brian;
$names[3]=james;
$names[4]=Dan;
sort($names);
for ($x=0;$x<sizeof($names);$x++){
echo $names[$x];
}
suggestions?
someone said add reset($names) after the sort, I tried that but no luck.