Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("pipe", "a")
);
<?php
$descriptorspec = array
(
1 => array("pipe", "w"),
2 => array("pipe", "w")
);
$process = proc_open("./foo", $descriptorspec, $pipes);
if (is_resource($process))
{
while (!feof($pipes[1]))
{
$a .= fgets($pipes[1], 1024);
}
fclose($pipes[1]);
while (!feof($pipes[2]))
{
$b .= fgets($pipes[2], 1024);
}
fclose($pipes[2]);
$return_value = proc_close($process);
print "command returned $return_value\n";
print 'stdout from program: ' . $a ."\n";
print 'stderr from program: ' . $b ."\n";
}
?>
#include <stdio.h>
int main()
{
fprintf (stdout, "To STDOUT: test test test\n");
fprintf (stderr, "To STDERR: tset tset tset\n");
return 19;
}
command returned 19
stdout from program: To STDOUT: test test test
stderr from program: To STDERR: tset tset tset