most recent dated

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Platero

    most recent dated


    Hi, how can I get the most recent dated file (or the last
    created/modified) in a specified directory?

    Thanks
  • Peter Münster

    #2
    Re: most recent dated

    On Fri, 25 Aug 2006, Platero wrote:
    Hi, how can I get the most recent dated file (or the last created/modified) in
    a specified directory?
    You can use scandir() to read all entries and filemtime() or stat() to get
    the modification time of each entry.
    Cheers, Peter

    --
    email: pmrb at free.fr
    Peter Münster *** Brittany *** France

    Comment

    • slave4code@gmail.com

      #3
      Re: most recent dated

      I hope it will help you :) ->

      Now just write that simple algorythm : )

      This is how to get file motification date
      <?php
      // outputs e.g. somefile.txt was last modified: December 29 2002
      22:16:23.

      $filename = 'somefile.txt';
      if (file_exists($f ilename)) {
      echo "$filename was last modified: " . date ("F d Y H:i:s.",
      filemtime($file name));
      }
      ?>

      Comment

      • Platero

        #4
        Re: most recent dated


        ok! Thanks very much! :-)

        Comment

        Working...