sorting multidimensional array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Sanoz0r
Forum Newbie
Posts: 3
Joined: Thu Nov 03, 2005 10:20 am
Location: Cape Town, South Africa

sorting multidimensional array

Post by Sanoz0r »

hey

im struggling to sort my multidimensional array.
Here is a basic of my array

$catList[0][0] = "19"; //being an ID
$catList[0][1] = "Speakers"; //being the category name

$catList[1][0] = "21";
$catList[1][1] = "Printers";

$catList[2][0] = "7";
$catList[2][1] = "Motherboards";

$catList[3][0] = "12";
$catList[3][1] = "Keyboards";

I want to sort by the category name only.
I have used array_multisort() in every way i can but either it sorts both or doesnt sort at all.

Thanks!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

try using usort()
Post Reply