I currently have a script displaying buses from particular companies which are pulled from a flatfile, but what i'm wanting is for it to sort the info by bus number or then by rego # in the event there is no bus number and in case the information isn't sorted in the database (of which would happen overtime). I've searched up sort, asort, ksort etc, and whilst they do their individual thing, they don't do exactly what im looking for. here is the current code if i may: and what this script does is firstly open up the operators database to display what operators are available (no issues there), then the 2nd part is once the operator's fleet is listed, it displays the fleet information (but currently unsorted). Any help would be greatly appreciated thanks...
You should really put this into an array and do it: asort($locarray); foreach ($locarray as $key => $val) { echo "$key = $val\n"; } Code (markup):
As i'm still trying to learn & understand php, I replaced the current asort statement with what you recomended, yet i got results which I don't think should've happened, so did i put that statement in the correct area or should it be elsewhere, or could it be something else?