PHP -popen()- Funktion
❮ Referenz zum PHP-DateisystemBeispiel
Öffnen Sie eine Pipe zu dem im Befehlsparameter angegebenen Programm :
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
Definition und Verwendung
Die Funktion popen() öffnet eine Pipe zu dem im Befehlsparameter angegebenen Programm.
Syntax
popen(command, mode)
Parameterwerte
Parameter | Description |
---|---|
command | Required. Specifies the command to execute |
mode | Required. Specifies the connection mode. Can be "r" (Read only) or "w" (Write only - opens and clears existing file or creates a new file) |
Technische Details
Rückgabewert: | FALSE bei Fehler |
---|---|
PHP-Version: | 4.0+ |
❮ Referenz zum PHP-Dateisystem