Home  >  Article  >  Backend Development  >  Commonly used global variables in php

Commonly used global variables in php

WBOY
WBOYOriginal
2016-07-29 08:58:211137browse

echo $_SERVER['PHP_SELF'],'
'; //The address of this page
echo $_SERVER['HTTP_REFERER'],'
';//Link to the previous page of the current page The address of
echo $_SERVER['SCRIPT_FILENAME'],'
'; //The absolute path of the current script
echo $_SERVER['REMOTE_ADDR'],'
'; //The IP address of the client
echo $_SERVER['QUERY_STRING'],'
';//Query string,? The following part
echo $_SERVER['DOCUMENT_ROOT'],'
'; //Document root directory
echo $_SERVER['SERVER_ADDR'],'
';//Server's ip

The above introduces the commonly used global variables in PHP, including related content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP 5 constantsNext article:PHP 5 constants