PHP popen () function
Definition and Usage
popen () function uses the command parameter to open the process file pointer.
If an error occurs, the function returns FALSE.
grammar
popen(command,mode)
参数 | 描述 |
---|---|
command | 必需。规定要执行的命令。 |
mode | 必需。规定连接模式。 可能的值:
|
Examples
<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>
Complete PHP Filesystem Reference Manual