note 38883 added to function.include
| From: | astle at lexi dot net | Date: | Sat, 10 Jan 2004 00:26:59 +0000 |
| Subject: | note 38883 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63230@lists.php.net to get a copy of this message | ||
For those of you who need to guarantee that you're including a file relative to your php script
when using the command line version, you can do something like this:
include(dirname($_SERVER['argv'][0]) . '/some/file');
Then if you call your script as /path/to/script.php, the above would include /path/to/some/file. Or,
if you called it as ./script.php, you would include ./some/file.
Of course, YMMV.
----
Manual Page -- http://www.php.net/manual/en/function.include.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38883
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38883&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38883&report=yes
Search -- http://master.php.net/manage/user-notes.php