Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default PHP File Functions... :S?

    Hi,

    Im making a script where I show all files uploaded in a directory. These files are uploaded via FTP & are not inserted into the database.

    Is there a way to fetch the time & date they were uploaded via FTP & to order them alphabetically etc...?

    +REP for any help.

    Lew.
    Im not here to be loved, I love to be hated :-}


  2. #2
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    2,015
    Tokens
    568

    Latest Awards:

    Default

    Use opendir() and readdir() to open the directory and get the filenames and filetypes, then use filemtime() or filectime() to get the time the files were last modified/changed. I think filectime() would be best, apparently that will just show the creation time if you're on windows.
    I think.

    I don't think readdir() has any way of sorting the results, so instead of echoing them all out straight away when you're looping through, just put them into an array then use sort() to put them alphabetically.

  3. #3
    Join Date
    Sep 2009
    Location
    Hull
    Posts
    827
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Trinity View Post
    Use opendir() and readdir() to open the directory and get the filenames and filetypes, then use filemtime() or filectime() to get the time the files were last modified/changed. I think filectime() would be best, apparently that will just show the creation time if you're on windows.
    I think.

    I don't think readdir() has any way of sorting the results, so instead of echoing them all out straight away when you're looping through, just put them into an array then use sort() to put them alphabetically.
    Thanks, I managed to get this working earlier with sort().

    Lew.
    Im not here to be loved, I love to be hated :-}


Posting Permissions

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