X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP popen() Function


PHP Filesystem Reference Complete PHP Filesystem Reference

Definition and Usage

The popen() function opens a pipe to the program specified in the command parameter.

This function returns FALSE if an error occurs.

Syntax

popen(command,mode)

Parameter Description
command Required. Specifies the command to execute
mode Required. Specifies the connection mode.

Possible values:

  • r: Read only
  • w: Write only (opens and clears existing file or creates a new file)


Example

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


PHP Filesystem Reference Complete PHP Filesystem Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook