PHP pclose() Function

❮ PHP Filesystem Reference

Example

Open and close a pipe to the program specified in the command parameter:

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


Definition and Usage

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

Syntax

pclose(pipe)

Parameter Values

Parameter Description
pipe Required. Specifies the pipe opened by popen()


Technical Details

Return Value: The termination status, -1 on failure
PHP Version: 4.0+

❮ PHP Filesystem Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.