pclose

(PHP 4, PHP 5, PHP 7)
Closes process file pointer
int pclose ( resource $handle )

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

Parameters:
handle

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

Returns:

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

Notes:
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.

Examples:
pclose() example
<?php
$handle = popen('/bin/ls', 'r');
pclose($handle);
?>

See also:

popen() -

doc_php
2016-02-24 15:56:58
Comments
Leave a Comment

Please login to continue.