In php I wish to display the result of a command output just as it would be shown on the console. To simplify this example we'll use ifconfig. The problem is php runs all lines together instead of dispaying it properly. I have tried to use shell_exec(), passthru(), and system() but they all display the same.
Using these two question as a reference I though passthru() would be the answer.
PHP - exec() vs system() vs passthru()
http://www.sitepoint.com/forums/showthread.php?525977-multiline-result-in-exec
Here is the php code:
<?php
$output = passthru("ifconfig");
echo $output;
?>