$ Aintval ($ _ SERVER [& #039; argv & #039;] [2]); $ _ SERVER [& #039; argv & #039;] [2] Why is it next to this place [2]? $ a = intval ($ _ SERVER ['argv'] [2]);
$ _ SERVER ['argv'] [2] Why is it followed by [2 ]?
Reply content:
$ A = intval ($
In PHP $ _ SERVER [argv], notice php $ _ SERVER [argv] appears.
Http: // localhost/demo. php? A = 123 & B = 132
Output:
Notice: Undefined index: args in F: \ php \ www \ demo. php on line 35
What's going on? please give us some advice.
PHP features: the command line mode starts with version 4.3.0. PHP provides a new type of cli sapi (Server Application Programming Interface, Server Application Programming Port) support, named CLI, command Line Interface, that is, Command Line
Php obtains the php server variable in the current url path.
Programming in php to obtain the current url address and server variables mainly uses the following global variables: $ _ server ["query_string"], $ _ server ["request_uri"], $ _
The variables included in PHP $ _ SERVER are global variables, which can be called Super global variables. Below I will give you a detailed explanation of common PHP $ _ SERVER usage, hoping to help you.
Frequently used $ _ SERVER [] Variables
$ _
Starting with version 4.3.0, PHP provides a new type of CLI SAPI (Server application Programming Interface, service-side application programming port) support, called CLI, which means Command line Interface , which is the command-line interface. As
The current complete url of php $ _ SERVER. The copy code is as follows:. $ _ SERVER [HTTP_HOST]. $ _ SERVER [PHP_SELF].?. $ _ SERVER [QUERY_STRING]; phpserver function Daquan SERVER [HTTP_ACCEPT] ** $ _ SERVER [HTTP_REFE
The code is as
Recently, comparing the features of PHP, Python, and Erlang found that PHP has many features that are not commonly used. PHPCLI can be used to implement many good applications. For example, search engine crawlers and long-running computing scripts
Php introduction to getting current url path functions and server variables
We will introduce the functions for getting the current url path in php and some server variables in php for your reference.Mainly used: $ _ SERVER ["QUERY_STRING"],
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.