PHP popen() Functie
❮ Referentie voor PHP-bestandssysteemVoorbeeld
Open een pijp naar het programma gespecificeerd in de opdrachtparameter :
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
Definitie en gebruik
De functie popen() opent een pijp naar het programma dat is opgegeven in de opdrachtparameter.
Syntaxis
popen(command, mode)
Parameterwaarden
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
Winstwaarde: | ONWAAR bij fout |
---|---|
PHP-versie: | 4.0+ |
❮ Referentie voor PHP-bestandssysteem