O'Reilly logo

Programming PHP, 3rd Edition by Peter MacIntyre, Kevin Tatroe, Rasmus Lerdorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

popen

Synopsis

resource popen(string command, string mode)

Opens a pipe to a process executed by running command on the shell.

The parameter mode specifies the permissions to open the file with, which can only be unidirectional (that is, for reading or writing only). mode must be one of the following:

r

Open file for reading; file pointer will be at beginning of file.

w

Open file for writing. If the file exists, it will be truncated to zero length; if the file doesn’t already exist, it will be created.

If any error occurs while attempting to open the pipe, false is returned. If not, the resource handle for the pipe is returned.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required