如何在exec中传递php变量?
我试图在exec()中传递php变量,但发现没有输出 first.php如何在exec中传递php变量?,php,variables,Php,Variables,我试图在exec()中传递php变量,但发现没有输出 first.php echo exec('php prog.php $var1 $var2'); $file = 'people.txt'; $person = $argv; file_put_contents($file, $argv, FILE_APPEND | LOCK_EX); second.php echo exec('php prog.php $var1 $var2'); $file = 'people.txt'; $
echo exec('php prog.php $var1 $var2');
$file = 'people.txt';
$person = $argv;
file_put_contents($file, $argv, FILE_APPEND | LOCK_EX);
second.php
echo exec('php prog.php $var1 $var2');
$file = 'people.txt';
$person = $argv;
file_put_contents($file, $argv, FILE_APPEND | LOCK_EX);
如何在exec()中传递php变量?尝试使用双引号
echo exec(“php prog.php$var1$var2”)代码>尝试使用双引号echo exec(“php prog.php$var1$var2”)代码>