update : 2015.11.03
php.shukuma.com

검색:
 
 
Closes process file pointer

pclose

(PHP 4, PHP 5, PHP 7)

pcloseCloses process file pointer

설명

int pclose ( resource $handle )

Closes a file pointer to a pipe opened by popen().

인수

handle

The file pointer must be valid, and must have been returned by a successful call to popen().

반환값

Returns the termination status of the process that was run. In case of an error then -1 is returned.

예제

Example #1 pclose() example

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

주의

Note: Unix Only:

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

참고

  • popen() - Opens process file pointer