SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sorting Files by Last Modified Time?

    Hi,

    How do you sort the files by their modified time?
    For example, I get their last modified time by:

    filemtime($path/$filename);

    Then what do I do?
    Thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    SitePoint Evangelist
    Join Date
    Dec 2000
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you are using MySQL to serve up the page, create a column called lmt and then whenever you change a page, punch in the date and time.

    In your PHP script's, SELECT statement you would have SORT BY lmt DESC. Hope that helps!
    Last edited by JustForWebmasters; Jun 16, 2001 at 07:14.
    Corbb O'Connor
    Looking for quality website design or database programming?
    Contact me for more information and a FREE quote!

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    okay..how do i punch in the date and time? =)
    is there a way to grab the last modified time form the file, then sort from there?

    i already have files in the database. opps
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


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
  •