Вывод выполнения команды в переменную

Hostill

Guest
Вывод выполнения команды в переменную

Выполняю скрипт bash, из пхп скрипта, и присваеваю этот вывод в переменную.
Таким образом:
$t=exec('/sbin/iptables -L outcount_192.168.0.75 -v -x ');

Но в переменную $t попадает только последняя строка скрипта. А мне нужно весь вывод в переменную. Подскажите, как быть?
 

rotoZOOM

ACM maniac
exec() executes the given command, however it does not output anything. It simply returns the last line from the result of the command. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.
Читаем мануал
 
Сверху