PCLOSE(3) 1 PCLOSE(3)
pclose - Closes process file pointer
SYNOPSIS
int pclose (resource $handle)
DESCRIPTION
Closes a file pointer to a pipe opened by popen(3).
PARAMETERS
o $handle
- The file pointer must be valid, and must have been returned by a successful call to popen(3).
RETURN VALUES
Returns the termination status of the process that was run. In case of an error then -1 is returned.
EXAMPLES
Example #1
pclose(3) example
<?php
$handle = popen('/bin/ls', 'r');
pclose($handle);
?>
NOTES
Note
Unix Only:
pclose(3) is internally implemented using the waitpid(3) system call. To obtain the real exit status code the pcntl_wexitstatus(3)
function should be used.
SEE ALSO
popen(3).
PHP Documentation Group PCLOSE(3)