Search notes:

PHP code snippets: __FILE__

__FILE__ expands to the absolute path of the file where this identifier occurs.
<!DOCTYPE html>
<html>
<head>
  <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
  <title>__FILE__</title>
</head>
<body>

<?php
  print "__FILE__ is: <code>" . __FILE__ ."</code>";
?>

</body>
</html>
Github repository about-php, path: /__FILE__.html

See also

$_SERVER['SCRIPT_FILENAME']
Other PHP snippets.

Index