windows下php命令行参数
程序员文章站
2023-12-29 13:56:22
...
Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\EVAN>cd c:\php5
C:\php5>php.exe cli.php uuu
PHP Warning: file_get_contents(uuu): failed to open stream: No such file or dir
ectory in C:\php5\cli.php on line 8
Warning: file_get_contents(uuu): failed to open stream: No such file or director
y in C:\php5\cli.php on line 8
cli.php
Code:
(C) 版权所有 1985-2001 Microsoft Corp.
C:\Documents and Settings\EVAN>cd c:\php5
C:\php5>php.exe cli.php uuu
PHP Warning: file_get_contents(uuu): failed to open stream: No such file or dir
ectory in C:\php5\cli.php on line 8
Warning: file_get_contents(uuu): failed to open stream: No such file or director
y in C:\php5\cli.php on line 8
cli.php
Code:
#!c:/php5/php -q array_shift($argv); if (count($argv) == 0) { $argv[0] = "php://stdin"; } foreach ($argv as $file) { $lines = split("\n", file_get_contents($file, "r")); shuffle($lines); foreach ($lines as $line) { if ($line !== "") { echo "$line\n"; } } } ?> |
推荐阅读
-
基于命令行执行带参数的php脚本并取得参数的方法,php脚本
-
在Windows下安装MySQL的图形管理工具phpMyAdmin_PHP
-
windows下安装了wamp,运行时打开直接打开php文件提示下载?
-
PHP中批量生成静态html(命令行下运行PHP)_PHP教程
-
Windows7下PHP开发环境安装配置图文方法_PHP教程
-
Windows XP下全新安装Apache2,PHP5,MYSQL5,Zend的简单过程_PHP
-
Windows下XDebug 手工配置与使用说明_PHP教程
-
Windows下安装PHP的MongoDB驱动
-
Windows 下编译PHP生成的文件里没有php5apache2_2.dll
-
在Windows的命令行下启动服务_MySQL