You can use command line variables -- $ argv and $ argc in php. you can use command line variables in php. Too many words are too abstract to speak with the script:
Echo $ argv [1]. "\ n ";
Echo $ argv [2]. "\ n ";
Echo $ argc. "\ n ";
Print_r
Execute the $ argv and $ argc configuration methods in the php script through the command line, argvargc
In actual work, you may encounter the need to execute a php script in the nginx command line. Of course, you can configure a conf file for
ARGC,ARGV useful when compiling programs with the command lineWe 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
$ Argv and $ argc in PHP
You can use command line variables in PHP. Too many words are too abstract to speak with the script:
Command behavior when running the Script: PhP argvtest. php TQ tqx
The output result is:
TQ tqx $ argv is an array 3
You can use command line variables in php. Too many words are too abstract to use scripts to speak: & lt ;? Phpecho $ argv [1]. & quot;/n & quot; echo $ argv [2]. & quot;/n & quot; echo $ argc. & quot;/n & quot; print_r ($ argv); var_dump ($ argv );?
you can use command line variables in PHP. Too many words are too abstract to speak with the script:
php echo $ argv [1]. "\ n"; echo $ argv [2]. "\ n"; echo $ argc. "\ n"; print_r ($ argv); var_dump ($ argv ); ?>
ARGC,ARGV useful when compiling programs with the command lineWe 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>&1Just like the timer
You can use command line variables in php. Too many words are too abstract to speak with the script: Command behavior when running the Script: php argvtest. php TQ TQx The output result is: TQ TQx $ argv is an array 3 Note $ argc variable, which is
This article mainly introduces the command line to execute PHP script $argv and $ARGC methods, this article gives you a very detailed introduction, the need for friends can refer to, hope to help everyone.
In the actual work may encounter the need
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
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.