PHP popen()ฟังก์ชั่น
❮ การอ้างอิงระบบไฟล์ PHPตัวอย่าง
เปิดไพพ์ไปยังโปรแกรมที่ระบุในพารามิเตอร์คำสั่ง :
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
ความหมายและการใช้งาน
ฟังก์ชัน popen() เปิดไพพ์ไปยังโปรแกรมที่ระบุในพารามิเตอร์คำสั่ง
ไวยากรณ์
popen(command, mode)
ค่าพารามิเตอร์
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) |
รายละเอียดทางเทคนิค
คืนมูลค่า: | FALSE เมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4.0+ |
❮ การอ้างอิงระบบไฟล์ PHP