Voting

: nine plus zero?
(Example: nine)

The Note You're Voting On

tapken at engter dot de
23 years ago
To get the directory of current included file:

<?php
dirname
(__FILE__);
?>

For example, if a script called 'database.init.php' which is included from anywhere on the filesystem wants to include the script 'database.class.php', which lays in the same directory, you can use:

<?php
include_once(dirname(__FILE__) . '/database.class.php');
?>

<< Back to user notes page

To Top