popen

PHP 4, PHP 5, PHP 7, PHP 8
popen - Opens process file pointer
Manual
Code Examples

Example #1 popen example

If the command to be executed could not be found, a valid resource is returned. This may seem odd, but makes sense; it allows you to access any error message returned by the shell:

PHP Version:

Example #2 popen example

PHP Version: