Php command line usage and command line parameter descriptions _ PHP Tutorial

Source: Internet
Author: User
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...

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.