note 48053 added to function.include

From: Date: Fri, 10 Dec 2004 00:30:31 +0000
Subject: note 48053 added to function.include
Groups: php.notes 
Request: Send a blank email to php-notes+get-81620@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. <? 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. ---- Manual Page -- http://www.php.net/manual/en/function.include.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48053 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48053&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48053&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#81620) next »