| Author |
finding the physical path of an include file when parsing
|
|
| advertis 2004-10-22, 8:55 pm |
| How do I find the path to an include file from inside the file when loaded?
The file is located above the doc root. The script which includes the file
is located in the doc root. The included file needs to include additional
files located in the same directory as itself. I am trying not to have to
edit the php.ini include_path or to set it at run-time using set_ini().
Any help would be appreciated. thanks
Patrick
| |
| Chris Hope 2004-10-22, 8:55 pm |
| advertis wrote:
> How do I find the path to an include file from inside the file when
> loaded? The file is located above the doc root. The script which includes
> the file is located in the doc root. The included file needs to include
> additional files located in the same directory as itself. I am trying not
> to have to edit the php.ini include_path or to set it at run-time using
> set_ini().
>
> Any help would be appreciated. thanks
realpath(__FILE__) will give you the full real path name to the current
file.
http://www.php.net/realpath
--
Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
| |
| advertis 2004-10-22, 8:55 pm |
| Works Great! thanks
"Chris Hope" <blackhole@electrictoolbox.com> wrote in message
news:1098485052_35193@216.128.74.129...
> advertis wrote:
>
includes[color=darkred]
not[color=darkred]
>
> realpath(__FILE__) will give you the full real path name to the current
> file.
>
> http://www.php.net/realpath
>
> --
> Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
|
|
|
|