Php command line usage and command line parameter descriptions. Copy the code as follows: [root @ localhost] # [root @ localhost] # php-rvar_dump (true); # Do you need to execute PHP code? Php ...? Label bool (true) [root @ localhost] # php-Rvar
The code is as follows:
[Root @ localhost/] #
[Root @ localhost/] # php-r "var_dump (true);" # PHP code execution is not required Tag
Bool (true)
[Root @ localhost/] # php-R "var_dump (true);" # execute every input line of PHP code
Bool (true)
Bool (true)
Bool (true)
[Root @ localhost/] #
[Root @ localhost/] # php-f "file" # execute the php code from the file
[Root @ localhost/] #
[Root @ localhost/] # php "test. php" id name sex
Int (4)
Array
(
[0] => test. php
[1] => id
[2] => name
[3] => sex
)
[Root @ localhost/] #
[Root @ localhost/] # cat test. php
Var_dump ($ _ SERVER ["argc"]); // gets the number of parameters passed in by the command line.
Print_r ($ _ SERVER ["argv"]); // gets the array of input parameters from the command line.
[Root @ localhost/] #
The http://www.bkjia.com/PHPjc/750860.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/750860.htmlTechArticle code is as follows: [root @ localhost/] # [root @ localhost/] # php-r "var_dump (true);" # Do you need to execute PHP code? Php ...? Label bool (true) [root @ localhost/] # php-R "var...