Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Need help with arrays

  1. #11
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes... but I'm not entirely sure why the above code isn't working. I wlll investigate.

    /EDIT: Oh, duh. This is an obvious one...
    Code:
    function DateCmp($a, $b)
    {
      return ($a[1] > $b[1]) ? -1 : 1;
    }
    Last edited by Twey; 03-21-2006 at 04:25 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #12
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Still doesn't make a difference, I know part of the problem. I remove the contents of the function DateCmp(), and it still shows the same old thing (files in the wrong order)... So DateCmp() isn't making a difference at all, no matter what you do with it. There must be a problem somewhere else in the code... Perhaps I shouldn't use a usort method...

  3. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Try using "DateCmp" instead of DateCmp as the argument to the usort function.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #14
    Join Date
    Mar 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Still no difference...

  5. #15
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Sounds painful, but you could rewrite it a bit. It's not too hard to write a loop that would reverse it.
    Then again your stuff is pretty complex now and that would just confuse it.
    Carry on.

    Brainstorming... not getting too far.

    ...And learning from what you guys are figuring out. thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •