Home > Backend Development > PHP Tutorial > PHP command line usage and command line parameter description_PHP tutorial

PHP command line usage and command line parameter description_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:34:32
Original
872 people have browsed it

Copy code The code is as follows:

[root@localhost /]#
[root@localhost /]# php -r "var_dump(true);" # Executing PHP code does not require tag
bool(true)
[root@localhost /]# php -R "var_dump(true );" # Execute each input line of PHP code

bool(true)

bool(true)

bool(true)
[root@localhost /] #
[root@localhost /]# php -f "file" # Execute php code from 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"]); // Get the number of parameters passed in from the command line
print_r($_SERVER["argv"]); // Get the array of parameters passed in from the command line

[root@localhost /]#

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/750860.htmlTechArticleCopy the code as follows: [root@localhost /]# [root@localhost /]# php -r "var_dump (true);" # No need to execute PHP code?php... ? Tag bool(true) [root@localhost /]# php -R "var...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template