This article for you to share some of the common commands under the PHP command line, the need for friends can refer to
1 php-m
Display the modules compiled into the kernel
2 Php-v
Show PHP Version number
3 PHP--ini
Show Profile Name
4 php-h
Shows which command-line commands are available
5 PHP--info
View class/function/extension information, like PHP using Phpinfo () on a Web server
6 PHP--rf <name>
Display information about the <name> function
7 PHP--RC <name>
Display information about the <name> class
8 PHP--re <name>
Display information about the <name> extension
9 php--ri <name>
Display Extended <name> configuration information
PHP--rz <name>
Display name information about the Zend extension
11 Development of command-line scripting
(1) $ARGV is an array that contains the supplied arguments, where the first parameter is the name of the file
(2) $ARGC is the number of parameters
eg
We have a index.php this script
<?php
Echo ' command line argument number: '. $ARGC. "N";
echo "Command-line arguments: n";
foreach ($argv as $index = = $arg) {
echo " {$index}: {$arg}\n";
}
Our command line runs PHP index.php 1 2 3
The results of the output are as follows:
Related recommendations:
PHP Common Commands _php Tutorial