开发者

tty with shell_exec?

开发者 https://www.devze.com 2023-03-23 23:26 出处:网络
Is it possible to do shell_exec in PHP, which requires a tty? <?php $output = shell_exec(\"read foo; echo $foo\");

Is it possible to do shell_exec in PHP, which requires a tty?

<?php
   $output = shell_exec("read foo; echo $foo");
?>

If not开发者_开发技巧, what are the alternatives?


What about:

<?php

echo shell_exec('read foo; export foo; echo $foo');

Note: The var foo will not be available in your shell after the script exit.

0

精彩评论

暂无评论...
验证码 换一张
取 消