Skip to content

Instantly share code, notes, and snippets.

@benwills
Created February 20, 2015 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benwills/cf753c974b1cf609b03a to your computer and use it in GitHub Desktop.
Save benwills/cf753c974b1cf609b03a to your computer and use it in GitHub Desktop.
char buf[BUFSIZ];
FILE *fp;
if ((fp= popen("/bin/php -f /webserver/pages/test.php", "r")) != NULL)
{
/* Read from the PHP command output */
while (fgets(buf, BUFSIZ, fp) != NULL)
{
/* Process the output from PHP as desired */
...
}
(void) pclose(ptr);
}
fclose(fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment