Jim Lucas wrote:
> Tanel Tammik wrote:
>> "Jim Lucas" wrote in message
>> news:4c0e99d9.20...@cmsws.com...
>>> Tanel Tammik wrote:
Hi,
i like to find the web root where the current file is. is there a better
solution? it must work both on linux and windows machines...
>>>
Tanel Tammik wrote:
> "Jim Lucas" wrote in message
> news:4c0e99d9.20...@cmsws.com...
>> Tanel Tammik wrote:
>>> Hi,
>>>
>>> i like to find the web root where the current file is. is there a better
>>> solution? it must work both on linux and windows machines...
>>>
>>> >> $root = explode('/', $_
> $_SERVER['DOCUMENT_ROOT']
> although a post on the manual mentions some variability between
> environments.
$root = (array_key_exists('DOCUMENT_ROOT', $_ENV)) ?
$_ENV['DOCUMENT_ROOT'] : $_SERVER['DOCUMENT_ROOT'];
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://w
On Tue, Jun 8, 2010 at 12:27 PM, Tanel Tammik wrote:
> Hi,
>
> i like to find the web root where the current file is. is there a better
> solution? it must work both on linux and windows machines...
>
> $root = explode('/', $_SERVER['DOCUMENT_ROOT']);
> $cwd = explode(DIRECTORY_SEPARATOR, __DIR_
"Jim Lucas" wrote in message
news:4c0e99d9.20...@cmsws.com...
> Tanel Tammik wrote:
>> Hi,
>>
>> i like to find the web root where the current file is. is there a better
>> solution? it must work both on linux and windows machines...
>>
>> > $root = explode('/', $_SERVER['DOCUMENT_ROOT']);
>> $c
Tanel Tammik wrote:
> Hi,
>
> i like to find the web root where the current file is. is there a better
> solution? it must work both on linux and windows machines...
>
> $root = explode('/', $_SERVER['DOCUMENT_ROOT']);
> $cwd = explode(DIRECTORY_SEPARATOR, __DIR__);
> $web_root = '/' . implode(
6 matches
Mail list logo