Issue
When I run the code below I get the output on new lines however the spacing is wrong.
Example code:
<?php
$data = shell_exec("df -h");
echo nl2br($data);
?>
Webpage output:
I used nl2br() to get the command on new lines which is close to what i want but how do i get the spacing to match the terminal spacing?
Terminal output:
Solution
I found the answer:
<?php
$data = shell_exec("df -h");
echo "<pre>$data</pre>";
?>
Gives me this output in the web:
Answered By - confused



0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.