On Mon, Feb 13, 2012 at 5:28 PM, Rui Hu <tchrb...@gmail.com> 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: tchrb...@gmail.com
> -----------------------------------------------------------------------------------------


$_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.


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

Reply via email to