#1
  1. No Profile Picture
    netman
    Guest
    Devshed Newbie (0 - 499 posts)
    How do you sort by a field in the last array?

    i.e. $list[$i]["date"] - I would like to sort the array by the date field.
  2. #2
  3. No Profile Picture
    netman
    Guest
    Devshed Newbie (0 - 499 posts)
    I figured it out. Here's what I used:

    function compare($a,$b)
    {return strcmp($a["date"],$b["date"]);}

    usort($list,compare);

Similar Threads

  1. multi selection list array problem
    By dor1979 in forum PHP Development
    Replies: 3
    Last Post: December 12th, 2003, 01:32 PM
  2. multi dimension array sort
    By corrupted_wise in forum Perl Programming
    Replies: 7
    Last Post: November 12th, 2003, 02:40 AM
  3. multi dimensional arrays - Can't grasp how to?
    By Kaleina in forum PHP Development
    Replies: 17
    Last Post: November 5th, 2003, 03:18 PM
  4. Replies: 7
    Last Post: November 5th, 2003, 03:56 AM
  5. foreach problem with multi dimensional array
    By jhaertel in forum PHP Development
    Replies: 3
    Last Post: November 4th, 2003, 11:30 PM

IMN logo majestic logo threadwatch logo seochat tools logo