How to run multiple commands in system, exec or shell_exec?

前端 未结 4 1073
小鲜肉
小鲜肉 2021-01-23 00:05

I\'m trying to run shell command like this from php:

ls -a | grep mydir

But php only uses the first command. Is there any way to force php to p

4条回答
  •  情书的邮戳
    2021-01-23 00:50

    If you want the output from the command, then you probably want the popen() function instead:

    http://php.net/manual/en/function.popen.php

提交回复
热议问题