PHP popen() Fungsi
Referensi Sistem File PHPContoh
Buka pipa ke program yang ditentukan dalam parameter perintah :
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
Definisi dan Penggunaan
Fungsi popen() membuka pipa ke program yang ditentukan dalam parameter perintah.
Sintaksis
popen(command, mode)
Nilai Parameter
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) |
Detail Teknis
Nilai Kembali: | SALAH pada kegagalan |
---|---|
Versi PHP: | 4.0+ |
Referensi Sistem File PHP