在txt文件Linux命令行上显示php输出

And*_*jal 4 php linux shell command-line centos

我目前有一个blacklist.php文件生成一个黑名单,我需要一个linux上的blacklist.txt文件,从php文件中提取输出.

这可能吗 ?

Lit*_*mus 9

如果你的blacklist.php将输出写入STDOUT,你可以像这样运行你的php脚本

php blacklist.php > blacklist.txt
Run Code Online (Sandbox Code Playgroud)


小智 1

只需运行脚本并将其重定向到 .txt 文件即可。就像是

php blacklist.php > blacklist.txt
Run Code Online (Sandbox Code Playgroud)