PHP command line use method and command-line parameter description

Source: Internet
Author: User
Tags php code

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/]#

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.