pclose

PHP 4, PHP 5, PHP 7, PHP 8
pclose - Closes process file pointer
Manual
Code Examples

pclose( resource$handle ): int

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.

Return Values

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

Note:

If PHP has been compiled with --enable-sigchild, the return value of this function is undefined.

Notes

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.

Related Functions

Example of pclose

Show all examples for pclose

PHP Version:


Function pclose:

Filesystem Functions

Most used PHP functions