Not much explanation needed here:
<?php
$file = "yourfilegoeshere.php";
$fileinfo = stat($file);
echo "File name: " . $file . "<br />";
echo "File type: ." . substr(strrchr( $file, "."), 1) . "<br />";
echo "Filesize: " . round(( $fileinfo[ "size" ] / 1024 ), 1) . "k <br />"; // size in bytes
echo "Last accessed: " . date("H:i:s, d/m/y", $fileinfo["atime"]) . "<br />"; // time of last access (Unix timestamp)
echo "Last Modified: " . date("H:i:s, d/m/y", $fileinfo["mtime"]); // time of last modification (Unix timestamp)
?>
Tim Bennett is a web designer and developer. He has a First Class Honours degree in Computing from
Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.