note 44181 added to function.array-multisort

From: Date: Fri, 16 Jul 2004 21:23:01 +0000
Subject: note 44181 added to function.array-multisort
Groups: php.notes 
Request: Send a blank email to php-notes+get-73419@lists.php.net to get a copy of this message
In reply to the post: "The original post is correct... not the second post on this code: The code from If you have an array that contains output from a SQL SELECT statment and you want to sort the array on a column, you have to create a separate array containing the values of that column like so:........" My array is organized in such a matter: array[0][0]=teammember1 [0][1]=teammember2 [0][2]=total_points array[1][0]=teammember1 [1][1]=teammember2 [1][2]=total_points etc. I wanted to sort by total_points. FYI, I could not get the original post code to work, but the modified one works for me, with the line: "array_multisort($sortarray,$rows);" ---- Manual Page -- http://www.php.net/manual/en/function.array-multisort.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+44181 Delete -- http://master.php.net/manage/user-notes.php?action=delete+44181&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+44181&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#73419) next »