Mailinglisten-Archive |
>Hallo Hartmut, hallo Liste!
Hi
>Ich habe jetzt mal die Sache auf einem WAMP System ausprobiert, dort
>funktioniert es auch ohne Probleme:
><?
>$command = "dir";
>exec ($command,$output);
>echo $output[0];
>?>
>$output enthdlt f|r jeden Index eine Zeile des Outputs von "dir",
>z.B."Datentrdger Laufwerk C: ..."!
>Aber wieso funktioniert dieses simple Skript nicht auf LAMP? Dort ist
>$output ein Array ohne Inhalt,
weil es den befehl "dir" nicht gibt. probier das:
<?php
exec("command.com /c dir", $array);
print "Exec lieferte ".count($array)." Zeilen:<br>\n";
while(list(,$v)=each($array))
{
print "$v<br>\n";
}
?>
--
/ Daniel Beulshausen
Mail: abe_(at)_flaemingnet.de
php::bar PHP Wiki - Listenarchive