vvz.nw.ru К занятиям по PHP

<< Массив $GLOBALS

Очень полезно с помощью цикла foreach вывести ключи и значения глобального массива $GLOBALS , а также ключи и значения тех его элементов, которые сами являются массивами. Отметим, что наличие некоторых элементов в массиве $GLOBALS зависит от текущих настроек PHP.


 Элементы массива $GLOBALS :
HTTP_POST_VARS => Array
_POST => Array
HTTP_GET_VARS => Array
_GET => Array
HTTP_COOKIE_VARS => Array
_COOKIE => Array
HTTP_SERVER_VARS => Array
_SERVER => Array
HTTP_ENV_VARS => Array
_ENV => Array
HTTP_POST_FILES => Array
_FILES => Array
_REQUEST => Array
GLOBALS => Array
k => GLOBALS
v => GLOBALS
 Элементы массива $GLOBALS['HTTP_SERVER_VARS'] :
UNIQUE_ID => U-fpgX8AAAEAAFSbThIAAAAI
HTTP_HOST => vvz.nw.ru
HTTP_ACCEPT_ENCODING => x-gzip, gzip, deflate
HTTP_USER_AGENT => CCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT_LANGUAGE => en-us,en-gb,en;q=0.7,*;q=0.3
HTTP_ACCEPT => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PATH => /sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE =>
Apache/2.2.13 (Unix) DAV/2 PHP/4.4.7 mod_perl/2.0.4 Perl/v5.8.8 Server at vvz.nw.ru Port 80

SERVER_SOFTWARE => Apache/2.2.13 (Unix) DAV/2 PHP/4.4.7 mod_perl/2.0.4 Perl/v5.8.8
SERVER_NAME => vvz.nw.ru
SERVER_ADDR => 195.70.213.244
SERVER_PORT => 80
REMOTE_ADDR => 54.197.94.141
DOCUMENT_ROOT => /opt/PRIVATE/vvz
SERVER_ADMIN => webmaster@vvz.nw.ru
SCRIPT_FILENAME => /opt/PRIVATE/vvz/Lessons/php/globals.php
REMOTE_PORT => 47469
GATEWAY_INTERFACE => CGI/1.1
SERVER_PROTOCOL => HTTP/1.0
REQUEST_METHOD => GET
QUERY_STRING =>
REQUEST_URI => /Lessons/php/globals.php
SCRIPT_NAME => /Lessons/php/globals.php
PHP_SELF => /Lessons/php/globals.php
PATH_TRANSLATED => /opt/PRIVATE/vvz/Lessons/php/globals.php
argv => Array
argc => 0
 Элементы массива $GLOBALS['_SERVER'] :
UNIQUE_ID => U-fpgX8AAAEAAFSbThIAAAAI
HTTP_HOST => vvz.nw.ru
HTTP_ACCEPT_ENCODING => x-gzip, gzip, deflate
HTTP_USER_AGENT => CCBot/2.0 (http://commoncrawl.org/faq/)
HTTP_ACCEPT_LANGUAGE => en-us,en-gb,en;q=0.7,*;q=0.3
HTTP_ACCEPT => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
PATH => /sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE =>
Apache/2.2.13 (Unix) DAV/2 PHP/4.4.7 mod_perl/2.0.4 Perl/v5.8.8 Server at vvz.nw.ru Port 80

SERVER_SOFTWARE => Apache/2.2.13 (Unix) DAV/2 PHP/4.4.7 mod_perl/2.0.4 Perl/v5.8.8
SERVER_NAME => vvz.nw.ru
SERVER_ADDR => 195.70.213.244
SERVER_PORT => 80
REMOTE_ADDR => 54.197.94.141
DOCUMENT_ROOT => /opt/PRIVATE/vvz
SERVER_ADMIN => webmaster@vvz.nw.ru
SCRIPT_FILENAME => /opt/PRIVATE/vvz/Lessons/php/globals.php
REMOTE_PORT => 47469
GATEWAY_INTERFACE => CGI/1.1
SERVER_PROTOCOL => HTTP/1.0
REQUEST_METHOD => GET
QUERY_STRING =>
REQUEST_URI => /Lessons/php/globals.php
SCRIPT_NAME => /Lessons/php/globals.php
PHP_SELF => /Lessons/php/globals.php
PATH_TRANSLATED => /opt/PRIVATE/vvz/Lessons/php/globals.php
argv => Array
argc => 0
 Элементы массива $GLOBALS['HTTP_ENV_VARS'] :
SELINUX_INIT => YES
CONSOLE => /dev/console
TERM => linux
LD_LIBRARY_PATH => /usr/apache2.2.13/lib:
INIT_VERSION => sysvinit-2.86
PATH => /sbin:/usr/sbin:/bin:/usr/bin
RUNLEVEL => 3
runlevel => 3
PWD => /
LANG => en_US.UTF-8
PREVLEVEL => N
previous => N
HOME => /
SHLVL => 2
_ => /usr/apache2.2.13/bin/httpd
 Элементы массива $GLOBALS['_ENV'] :
SELINUX_INIT => YES
CONSOLE => /dev/console
TERM => linux
LD_LIBRARY_PATH => /usr/apache2.2.13/lib:
INIT_VERSION => sysvinit-2.86
PATH => /sbin:/usr/sbin:/bin:/usr/bin
RUNLEVEL => 3
runlevel => 3
PWD => /
LANG => en_US.UTF-8
PREVLEVEL => N
previous => N
HOME => /
SHLVL => 2
_ => /usr/apache2.2.13/bin/httpd
 Элементы массива $GLOBALS['GLOBALS'] :
HTTP_POST_VARS => Array
_POST => Array
HTTP_GET_VARS => Array
_GET => Array
HTTP_COOKIE_VARS => Array
_COOKIE => Array
HTTP_SERVER_VARS => Array
_SERVER => Array
HTTP_ENV_VARS => Array
_ENV => Array
HTTP_POST_FILES => Array
_FILES => Array
_REQUEST => Array
GLOBALS => Array
k => v
v => GLOBALS
kg => GLOBALS
vg => Array
k1 => vg
v1 => vg


vvz.nw.ru  > PHP