在命令行下运行PHP脚本[带参数]的方法

2019-04-10 02:27:25于海丽

?>


下面是其用法的示例:

shell> php phpbook.php 21/05/2005 7 single
You have requested a single room for 7 nights, checking in on 21/05/2005. Thank you for your order!

在这里,脚本首先会检查$argc,以确保自变量的数量符合要求。它然后会从$argv里提取出每一个自变量,把它们打印输出到标准的输出
相关文章 大家在看