Get the absolute filename from the current script in PHP

Description

The following code shows how to get the absolute filename from the current script.

Example


<?php /*from   w  w w .jav a2 s. c  o m*/
$lastmod = filemtime($_SERVER['SCRIPT_FILENAME']); 

echo 'file was updated on ' . date('l d F Y, \a\t H:i:s T', $lastmod); 
?>

The code above generates the following result.





















Home »
  PHP Tutorial »
    Development »




Environment
Error
Hash
Include
Locale
Math
Network
Output
Reflection
PHP Regular Expressions