PHP Command line
PHP 命令行获取传参代码出处:http://www.haowei.me/archives/916.html代码演示:http://www.haowei.me/archives/916.html?osc
PHP 命令行获取传参
代码出处:http://www.haowei.me/archives/916.html
代码演示:http://www.haowei.me/archives/916.html?osc
代码出处:http://www.haowei.me/archives/916.html
代码演示:http://www.haowei.me/archives/916.html?osc
[hacker@broiler /]# php -r "echo \"PHP Command Line.\";" PHP Command Line. [hacker@broiler /]# [hacker@broiler /]# [hacker@broiler /]# php -r "echo __FILE__;" Command line code [hacker@broiler /]# [hacker@broiler /]# [hacker@broiler /]# php "test.php" 1 2 3 4 int(5) Array ( [0] => test.php [1] => 1 [2] => 2 [3] => 3 [4] => 4 ) [hacker@broiler /]# [hacker@broiler /]# [hacker@broiler /]# cat test.php <?php var_dump($_SERVER["argc"]); print_r($_SERVER["argv"]); [hacker@broiler /]# [hacker@broiler /]#
- 上一篇:获取当前执行的文件名称
- 下一篇:计算字符长度,中文算2个(utf8编码)
精彩图集
精彩文章