Php 在shell_exec()中将网页内容作为字符串参数传递

Php 在shell_exec()中将网页内容作为字符串参数传递,php,shell-exec,Php,Shell Exec,若我传递了字符串内容,那个么它工作正常,在提交时它会显示结果。 但是当我通过使用escapeshellarg(strip_tags($text))传递收到的网页内容时。它在屏幕上什么也不显示 <?php //sent has value "http://www.paulgraham.com/herd.html" $url=$_POST['sent']; $text = file_get_contents($url); $temp=escapeshellarg(strip_tags($tex

若我传递了字符串内容,那个么它工作正常,在提交时它会显示结果。 但是当我通过使用escapeshellarg(strip_tags($text))传递收到的网页内容时。它在屏幕上什么也不显示

<?php
//sent has value "http://www.paulgraham.com/herd.html"
$url=$_POST['sent'];
$text = file_get_contents($url);
$temp=escapeshellarg(strip_tags($text));
//$temp="one two two"; If I pass $temp with string content it gives result
echo $temp;  //Echo $temp shows content of webpage 
$output=shell_exec("/home/technoworld/Videos/LinSocket/Modular/x '$temp'");
echo $output;
?>

感谢您在这里的参与:

我得到了答案:

<?php
//sent has value "http://www.paulgraham.com/herd.html"
$url=$_POST['sent'];
$text = file_get_contents($url);
$temp=escapeshellarg(strip_tags($text));
$output=shell_exec("/home/technoworld/Videos/LinSocket/Modular/x " . $temp);
echo $output;
?>


escapeshellarg()
(我的重点):“
escapeshellarg()
在字符串周围添加单引号,并引用/转义任何现有单引号,允许您将字符串直接传递给shell函数,并将其视为单个安全参数。”