$_server[' php_self ': The name of the file that is currently executing the script, related to document root. $_server[' argv ': arguments passed to the script. $_server[' argc ': Contains the number of command-line arguments that are passed to the
PHP programming often need to use some of the server's information, special $_server detailed parameters to organize, convenient for later use. $_server[' php_self ') #当前正在执行脚本的文件名, related to document root. $_server[' argv '] #传递给该脚本的参数. $_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[' server_name '//name of the server
Variables: $_server, used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _server_vars
Variables: $_env, used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _env_vars
Variables: $_cookie, used in PHP 4.1.0
Copy Code code as follows:
echo "Current operating system information." Php_os. " ";
Echo ' This file path and file name is: '. __file__. ' ';
echo "Current PHP version information." Php_version. " ";
?>
commonly used PHP
We are today to introduce you to the PHP to obtain the current URL function of the specific method, through the understanding of this function method, further deepen our understanding of the PHP language, improve our learning level.
Examples of PHP
The simplest of
Namevirtualhost *
ServerName Rashost.com/blogDocumentRoot "c:/wamp/www/vpsblog/" above the configured site is vpsblog.rashost.com/, the site corresponding to the directory is "c:/wamp/www/vpsblog/", Site name and directory name you
$_server[' php_self '] #当前正在执行脚本的文件名, associated with document root.
$_server[' argv '] #传递给该脚本的参数.
$_server[' argc '] #包含传递给程序的命令行参数的个数 (if run in command line mode).
$_server[' Gateway_interface '] #服务器使用的 the version of the CGI specification.
Sapi:server application Programming Interface Server-side application programming port. It is the interface that PHP interacts with other applications, and PHP scripts can be executed in many ways, either through a Web server or directly under the
The code is as follows:
$_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['
$_server Predefined variables
Server variables: $_server
Note: Used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _server_vars.
$_server is an array that contains such things as the head (headers), the path (paths), and the
Readers of apache| servers often experience this situation: when accessing certain resources of some Web sites, the browser pops up a dialog box asking for a username and password to gain access to the resource. This is a technology of user
This article mainly introduces the usage instructions of $ _ SERVER in PHP. For more information, see
This article mainly introduces the usage instructions of $ _ SERVER in PHP. For more information, see
Some SERVER information is often used
$ _ SERVER array element description $ _ SERVER ['php _ SELF '] # File Name of the script being executed, which is related to document root. $ _ SERVER ['argv'] # parameters passed to the script. $ _ SERVER ['argc '] # contains the number of command
$ _ SERVER ['php _ SELF '] # File Name of the script being executed, which is related to document root.$ _ SERVER ['argv'] # parameters passed to the script.$ _ SERVER ['argc '] # contains the number of command line parameters passed to the Program (
$_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
Article Title: Apache concurrent connections and bandwidth control in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems,
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.