ARGC,ARGV useful when compiling programs with the command line
We will find such parameters in the timed task script, $obj->run ($argv [1]);
*/30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/commands/test.php 1 >/dev/null 2>&1
Just like the timed task above, if we call him with the parameter $argv[1], that means the first string in the script that executes the program name on the DOS command line
That corresponds to the Red 1 in the script above, if we deploy the scheduled tasks listed below
*/30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/commands/test.php 1 >/dev/null 2>&1
*/30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/commands/test.php 2 >/dev/null 2>&1
*/30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/commands/test.php 3 >/dev/null 2>&1
Then we think that this task is divided into three processes running, that is to say, the pressure into the original One-third, so it is easy to understand
The official explanations for these two keywords are released below.
ARGC: Integer that counts the number of command-line arguments sent to the main function when you run the program
* argv: An array of strings to hold an array of pointers to your string arguments, each of which points to a parameter
ARGV[0] Full path name to program run
ARGV[1] point to the first string after executing the program name on the DOS command line
ARGV[2] Pointer to the second string after the name of the executing program
ARGV[ARGC] is null
http://www.bkjia.com/PHPjc/327799.html www.bkjia.com true http://www.bkjia.com/PHPjc/327799.html techarticle argc,argv Useful when compiling a program with the command line we will find such parameters in the timed task script, $obj-run ($argv [1]); */30 * * * */usr/local/bin/php/htdocs/test.com/uaqm/ Comma ...