sort multidimensional array?
| From: | phpman | Date: | Tue, 27 Mar 2001 20:56:02 +0000 |
| Subject: | sort multidimensional array? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45783@lists.php.net to get a copy of this message | ||
Hello,
i have this code:
while ($row = mysql_fetch_array($results)) {
$tmp = get_item_reorder_priority($row["item_sku"]);
$list[$r]["priority"] = $tmp[0];
$list[$r]["sku"] = $row["item_sku"];
$r++;
}
$list = array_multisort($list["priority"], SORT_NUMERIC, SORT_DESC);
and it returns this error:
Warning: Argument 1 to array_multisort() is expected to be an array or a
sort flag in d://www/inventory_specific.phtml on line 109
function get_item_reorder_priority() returns an array - with $tmp[0] being
an integer 1-5
$row["item_sku"] is simply a string.
I'm trying to sort by priority numbers (1-5). Any help would be
appreciated.
-dave