Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • filemtime() Function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 114
    Comment on it

    The filemtime() function is used to get the modification time of the file i.e., the time file was last modified. Syntax:

    filemtime($filename);
    

    In above function there is only one parameter which is the name of the file you want to get the modification details. This function returns the last modification time of the file on success else false on failure.

    For example:

    Suppose we have a file name demo.txt and we need the modification time of the file.

    <?php
    $filename = 'demo.txt';
    if (file_exists($filename)) {
        echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
    }
    ?>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: