我会提供一个例子 我想要的目录列表写入到文件 所以我这样做如何编写exec命令(在PHP中)输出到文件?
<?php
$command="dir";
exec($command,$output);
//i want the directory list to be written to a file
// so i did this
$fp=fopen("file.txt","w");
fwrite($fp, $output);
//its actually writing the 0(return value for exec is int) to the file
// but i want the list of directories to be written to file
?>
其实际写入0(回报EXEC值INT),该文件 但我想要目录列表写入文件 请告诉我一种方法来做到这一点
谢谢@AlexGidan。有用。 :) – user3737132
不客气,很高兴它帮助! –