note 38883 deleted from function.include by nlopess
| From: | nlopess@php.net | Date: | Sat, 10 Jan 2004 09:53:33 +0000 |
| Subject: | note 38883 deleted from function.include by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-63241@lists.php.net to get a copy of this message | ||
Note Submitter: astle@lexi.net
----
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.