sorting multi-dim arrays based on keys (like SQL's ORDER BY)
| From: | Francisco Hernandez | Date: | Fri, 16 Mar 2001 04:32:06 +0000 |
| Subject: | sorting multi-dim arrays based on keys (like SQL's ORDER BY) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-44205@lists.php.net to get a copy of this message | ||
hi,
How could i sort data in a multi-dim array?
for example:
$data = array(
array("Job 3","House Party","Done"),
array("Job 1","Days End","Done"),
array("Job 5","Light Wave House","Done"),
array("Job 2","The Amazon","Not Done"),
array("Job 4","Fear","Not Done")
);
I want to sort that array via the first,second or third key (Job ID,Job
Title,Job Status)
basically what i need to end up doing is having a table where i can click on
the header colums and sort ascending/descending based on the heading i
clicked
very much like SQL's ORDER BY, which ive been using so far, but now ive come
into a situation where the data cant be fetched from a DB.
Thanks in advance