note 33287 added to function.popen
| From: | SPAMFROMNEWS at FREAX dot ORG | Date: | Fri, 20 Jun 2003 22:07:10 +0000 |
| Subject: | note 33287 added to function.popen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50772@lists.php.net to get a copy of this message | ||
function filterThroughCmd($input, $commandLine) {
$input = str_replace ("\\", "\\\\", $input);
$input = str_replace ("\"", "\\\"", $input);
$pipe = popen("echo \"$input\"|$commandLine" , 'r');
if (!$pipe) {
print "pipe failed.";
return "";
}
$output = '';
while(!feof($pipe)) {
$output .= fread($pipe, 1024);
}
pclose($pipe);
return $output;
}
----
Manual Page -- http://www.php.net/manual/en/function.popen.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33287
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33287&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33287&report=yes