note 38227 deleted from function.usort by vincent
| From: | vincent@php.net | Date: | Fri, 12 Dec 2003 22:55:53 +0000 |
| Subject: | note 38227 deleted from function.usort by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-61879@lists.php.net to get a copy of this message | ||
Note Submitter: wgilk [at] runbox [dot] com
----
can someone figure out a way to sort a multi-dimensional associative array?
an example of my data:
---------
$social = array (
array (
"name" => "Civics",
"teacher" => "Bergquist",
"prerequisite" => "",
"notes" => ""
),
array (
"name" => "Personal Finance",
"teacher" => "Bergquist",
"prerequisite" => "",
"notes" => ""
),
array (
"name" => "Psychology",
"teacher" => "E. Holsen",
"prerequisite" => "",
"notes" => ""
),
array (
"name" => "US History",
"teacher" => "Bergquist",
"prerequisite" => "",
"notes" => ""
),
array (
"name" => "Art History",
"teacher" => "K. Holsen",
"prerequisite" => "",
"notes" => ""
),
);
--------------
i would like to sort this data based on the "name" value of each associative array. the
"name", "teacher", etc. should not be displayed, but all of the values need to
but outputted.
i have been beating my head against this one for two days and i can't figure out a good way to
do it.