Re: questions about $_SERVER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 13, 2012 at 5:28 PM, Rui Hu <tchrbupt@xxxxxxxxx> wrote:
> hi,
>
> How PHP sets variables in $_SERVER, say, $DOCUMENT_ROOT? What should I know
> if I want to modify $_SERVER myself?
>
> Thanks!
>
>
> --
> Best regards,
>
> Rui Hu
> ----------------------------------------------------------------------------------------
> State Key Laboratory of Networking & Switching Technology
> Beijing University of Posts and Telecommunications(BUPT)
> MSN: tchrbupt@xxxxxxxxx
> -----------------------------------------------------------------------------------------

Rui,

$_SERVER is an associative array. You can access "DOCUMENT_ROOT" with
$_SERVER['DOCUMENT_ROOT']. It contains the document root directory
under which the current script is executing.

You can make changes to the $_SERVER array but it will have no effect
on PHP itself. I mean, you can change the value of
$_SERVER['DOCUMENT_ROOT'] to whatever you want at runtime, but of
course it will not actually change the current directory if that's
what you're after.

Thanks,
Michael

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux