$_server[' php_self '] will get the result of/test.php/foo.bar. The __FILE__ constant contains the absolute path and file name of the current (for example, the containing) file.If PHP is run as a command line, the variable is not valid until PHP 4.3.
PHP programming often need to use some of the server's information, I put the commonly used in highlighting the way out, the rest is put in the back. Easy access later$_server['Http_accept_language']//Browser Language$_server['REMOTE_ADDR']//The
PHP gets basic information about the server:$_server[' http_accept_language ']//browser language$_server[' REMOTE_ADDR '//Current user IP.$_server[' remote_host '///Current User host name$_server[' Request_uri ']//url$_server[' remote_port '//port.$_
SERVER variable $ _ SERVER details: 1. $ _ SESSION [PHP_SELF] -- get the file name of the currently executing Script 2, $ _ SERVER [SERVER_PROTOCOL] -- the name and version of the communication protocol when requesting the page. For example, HTTP1.0.
Public platform development public platform developer public platform development mode browser HTTP_USER_AGENTAuthor: Fang Times studioOriginal article: http://www.cnblogs.com/txw1958/archive/2013/05/25/weixin-if31-http_user_agent.html
In the
1. $ _ SESSION [PHP_SELF] -- get the file name of the currently executing Script 2, $ _ SERVER [SERVER_PROTOCOL] -- the name and version of the communication protocol when requesting the page. For example, "HTTP1.0 ". 3. $ _ SERVER [REQUEST_TIME] --
PHP Extra-Curricular notes--$_server detailed parameters and instructions PHP Training tutorial for $_server introduction, while in PHP output $_server related information statements:echo ""; Var_dump ($_server);?>$_server[' php_self ']
For example, I need to obtain the current URL $ url_this. $ _ SERVER [HTTP_HOST]. $ _ SERVER [PHP_SELF]; echo $ url_this;: localhostlu. php SERVER variable: $ _ SERVER Note: Used in PHP4.1.0 and later versions. In earlier versions, $
PHP gets the path, name, and server path of the running file before the current period
echo "Displays the relative path and file name of the script file: \" ". $_server[" Php_self "]." \"";echo "Displays the CGI script specification used by the
$_server[' Http_accept_language ']//Browser Language$_server[' REMOTE_ADDR ']//Current User IP$_server[' Remote_host ']//Current User host name$_server[' Requesr_uri ']//URL$_server[' Remote_port ']//Port. $_server[' server_name ']//the name of the
$ _ SERVER ['php _ SELF '] function usage # File Name of the script being executed, which is related to document root.
$ _ SERVER ['argv'] function usage # parameters passed to the script.
$ _ SERVER ['argc '] function usage # contains the number
$_server[' REMOTE_ADDR '//Current user IP.$_server[' remote_host '///Current user host name$_server[' Request_uri ']//url$_server[' http_accept_language ']//browser language$_server[' remote_port '//port.$_server[' server_name '//name of the server
PHP $_server variables$_server is an array that contains such things as header information (header), path, and script location (scripts locations). It is a super global variable in PHP, and we can access it directly from anywhere in the PHP program.$
PHP programming often need to use some of the server's information, I put the commonly used in highlighting the way out, the rest is put in the back. Easy access later$_server [' Http_accept_language '] // $_server//$_server//$_server// URLThe
$_server is an array of information, such as header information (header), path, and script location (scripts locations), and so on. The items in this array are created by the WEB server. There is no guarantee that each server will provide all the
PHP tutorials get full URL address bar parameters in a variety of ways:$_server["Server_port"]//get port$_server[' Http_host ']//get the domain name or host address$_server[' server_name ']//what does it mean to get a domain name or a host site php:/
$_server[' http_accept_language ']//browser language $_server[' REMOTE_ADDR ']//Current user IP. $_server[' remote_host '//Current user hostname $_server[' request_uri ']//url$_server[' remote_port ']//port. $_server[' server_name '//name of the
In-depth analysis of server variable $_server:
1, $_session[' php_self ']--gets the filename of the currently executing script
2, $_server[' Server_protocol ']--the name and version of the communication protocol when the page is requested. For
The business community soon saw its value, with many companies setting up homepages, using the web to post messages online, and counter it as an interface to a variety of services, such as customer service, detailed descriptions of specific products
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.