English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP Tutorial

Advanced PHP Tutorial

PHP & MySQL

PHP Reference Manual

PHP pclose() Function Usage and Example

PHP Filesystem Reference Manual

The pclose() function can close the pipe opened by popen() and return the termination status of the running process. If an error occurs, it returns -1.

Syntax

int pclose ( resource $handle )

This function can close the file pointer to the pipe opened by popen().

Online Example

<?php
   $file = popen("/bin/ls", "r");
   pclose($file);
?>

PHP Filesystem Reference Manual