pclose

(PHP 4, PHP 5, PHP 7)

pclose关闭进程文件指针

说明

pclose ( resource $handle ) : int

关闭用 popen() 打开的指向管道的文件指针。

参数

handle

文件指针必须有效,且必须是成功调用 popen() 所返回的。

返回值

返回运行的进程的终止状态。发生错误时会返回 -1

范例

Example #1 pclose() 例子

<?php
$handle 
popen('/bin/ls''r');
pclose($handle);
?>

注释

Note: Unix Only:

proc_close() is internally implemented using the waitpid(3) system call. To obtain the real exit status code the pcntl_wexitstatus() function should be used.

参见

  • popen() - 打开进程文件指针