PHP Tutorial - PHP pclose() Function






Definition

The pclose() function closes a pipe opened by popen().

Syntax

PHP pclose() Function has the following syntax.

pclose(pipe)

Parameter

ParameterIs RequiredDescription
pipeRequired.Pipe opened by popen()

Return

This function returns FALSE on failure.

Example

Close a pipe opened by popen()

<?php
$file = popen("/bin/ls","r");
//some code to be executed
pclose($file);
?>