In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "how to use argv in php". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
In PHP, "$argv" is used to hold parameters pointing to strings, an array of parameters passed to the script, each element points to a parameter, and the first parameter is always the file name of the current script; "$argv" is defined in the "$_ SERVER" global array and is available only when "register_argc_argv" is opened.
This article operating environment: Windows10 system, PHP7.1 version, Dell G3 computer.
What is the use of argv in php
$argv-an array of parameters passed to the script
An array of strings that holds an array of pointers to your string parameters, each element pointing to a parameter
Description
An array of parameters passed to the current script when running under the command line.
Note:
The first parameter is always the file name of the current script, so $argv [0] is the script file name.
This variable is only available when register_argc_argv is turned on.
Argv- is defined in the $_ SERVER global array (the argv variable is passed to the program's C-style command-line arguments when the script is run on the command line).
Examples are as follows:
When using this command to execute: php script.php arg1 arg2 arg3
The output of the above routine is similar to:
Array (4) {[0] = > string (10) "script.php" [1] = > string (4) "arg1" [2] = > string (4) "arg2" [3] = > string (4) "arg3"} "how to use argv in php" is here. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.