Q:

Write a PHP script to get last modified information of a file

0

Write a PHP script to get last modified information of a file.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

<?php
$current_file_name = basename($_SERVER['PHP_SELF']);
$file_last_modified = filemtime($current_file_name); 
echo "Last modified " . date("l, dS F, Y, h:ia", $file_last_modified)."\n";
?>
Sample Output:
Last modified Monday, 26th June, 2017, 02:06pm

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now