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); ?> |
A pipe opened by popen() is closed using the pclose() function.
pclose(pipe) |
Parameter |
Description |
pipe |
Essential. identifies the pipe that popen() opened. |
Return Value: |
Upon failure, the termination state is -1. |
PHP Version: |
4.0+ |