0%

一些php知识

argc和argv

$argv代表传递的参数,$argc代表参数个数(相对路径+传的参数)
示例

1
2
3
4
5
6
<?php
echo $argv[0]; echo "\n";
var_dump($argv[1]); echo "\n";
var_dump(intval($argv[2])); echo "\n";
echo $argv[3]; echo "\n";
echo $argc;