<?php
/*
//命令行输入输出流
fwrite(STDOUT,"Enter your name:");
$name =
trim(fgets(STDOUT));
fwrite(STDOUT,"hello,$name");
*/
echo
$argc;
if ($argc > 1){
print_r($argv);
}
?>
另存为 ./test.php
[root@xiuran test]# php ./test.php xxx fdf
3Array
(
[0]
=> test.php
[1] =>
xxx
[2] =>
fdf
)
如何在CLI命令行下运行PHP脚本,同时向PHP脚本传递参数?,布布扣,bubuko.com
如何在CLI命令行下运行PHP脚本,同时向PHP脚本传递参数?
原文:http://www.cnblogs.com/lixiuran/p/3701958.html