Skip to content

Instantly share code, notes, and snippets.

@Arthraim
Created April 21, 2011 09:12
Show Gist options
  • Save Arthraim/934036 to your computer and use it in GitHub Desktop.
Save Arthraim/934036 to your computer and use it in GitHub Desktop.
a PHP popen demo
<html>
<head>
<title>ping</title>
</head>
<body>
<?php
echo "<h1>ping</h1>";
$file_handle = popen("ping artori.us", "r");
while (!feof($file_handle)) {
$line = fgets($file_handle);
echo $line;
echo "<br />";
}
pclose($file_handle);
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment