Re: [PHP] finding the web root

2010-06-08 Thread Jim Lucas
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... >>>

Re: [PHP] finding the web root

2010-06-08 Thread Jim Lucas
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('/', $_

Re: [PHP] finding the web root

2010-06-08 Thread Micky Hulse
> $_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

Re: [PHP] finding the web root

2010-06-08 Thread Nathan Nobbe
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_

Re: [PHP] finding the web root

2010-06-08 Thread Tanel Tammik
"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

Re: [PHP] finding the web root

2010-06-08 Thread Jim Lucas
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(