File modification information - Php

File Modify time

Snippet Code


  
Rate this page :
  [ 0 votes]

Outputs the date and time that a file was last modified. Can be formatted however you wish.Displays information about a visitor to a web page. Shows IP address and browser type.Outputs the time in seconds that it takes for a PHP page to load.

<?php echo date("l, F d, Y h:i" ,time()); $filename="3.php"; $last_modified = filemtime($filename); echo" "; print "Last modified " .$filename." ". date("l, dS F, Y @ h:ia", $last_modified); echo" "; echo "<p>IP Address: " . $_SERVER['REMOTE_ADDR'] . "</p>"; //echo "<p>Referrer: " . $_SERVER['HTTP_REFERER'] . "</p>"; echo "<p>Browser: " . $_SERVER['HTTP_USER_AGENT'] . "</p>"; echo" "; $time = microtime(); $time = explode(" ", $time); $time = $time[1] $time[0]; $start = $time; $time = microtime(); $time = explode(" ", $time); $time = $time[1] $time[0]; $finish = $time; $totaltime = ($finish - $start); printf ("This page took %f seconds to load.", $totaltime); ?>

Tags


Ask Questions

Ask Question