This article mainly introduces the PHP command line use method and command-line parameter description, need friends can refer to the following
The code is as follows: [Root@localhost/]# [root@localhost/]# php-r ' Var_dump (true); # do not need <?php to execute PHP code ...? > label bool (TRUE) [root@localhost/]# php-r "Var_dump (true);" # Execute PHP code every input row bool (TRUE) bool (TRUE) bool (true) [Root@localhost/]# [root@localhost/]# php-f "file" # Execute PHP code to From file [root@localhost/]# [root@localhost/]# php "test.php" ID name sex int (4) Array ([0] => test.php [1] =&G T ID [2] => name [3] => sex) [Root@localhost/]# [root@localhost/]# cat test.php <?php var_dump ($_serve r["ARGC"]); Gets the number of incoming arguments in the command line Print_r ($_server["argv"]); Gets the array of command-line incoming arguments [root@localhost/]#