note 48053 modified in function.include by danbrown

From: Date: Mon, 18 May 2009 01:05:58 +0000
Subject: note 48053 modified in function.include by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155482@lists.php.net to get a copy of this message
The __FILE__ macro will give the full path and name of an included script when called from inside the script. E.g. <?php include("/different/root/script.php"); ?> And this file contains: <?php echo __FILE__; ?> The output is: /different/root/script.php Surprisingly useful :> Obviously something like dirname(__FILE__) works just fine. --was-- The __FILE__ macro will give the full path and name of an included script when called from inside the script. E.g. <? include("/different/root/script.php"); ?> And this file contains: <? echo __FILE__; ?> The output is: /different/root/script.php Surprisingly useful :> Obviously something like dirname(__FILE__) works just fine. http://php.net/manual/en/function.include.php

« previous php.notes (#155482) next »