Adding BR tags to system(), exec(), and so on....
Posted: Mon Mar 19, 2007 5:06 pm
System, exec, popen, and other such commands are enabled on my server. I want to utilize them for compression and copying, but there's a problem.
I need to display output in a readable manner. However, no matter what I do, preg_replace nor nl2br will fix the linebreaks.
That script outputs this:
And the source is:
How do I add BR?
I need to display output in a readable manner. However, no matter what I do, preg_replace nor nl2br will fix the linebreaks.
Code: Select all
<?PHP
$ls = system("ls");
$ls = nl2br($ls);
print $ls."<P> Test Run.";
?>Code: Select all
adm cache common.php config.php cron.php docs download.php faq.php files images includes index.php install language ls.php mcp.php memberlist.php posting.php report.php search.php store style.php styles ucp.php viewforum.php viewonline.php viewtopic.php viewtopic.php
Test Run.Code: Select all
adm
cache
common.php
config.php
cron.php
docs
download.php
faq.php
files
images
includes
index.php
install
language
ls.php
mcp.php
memberlist.php
posting.php
report.php
search.php
store
style.php
styles
ucp.php
viewforum.php
viewonline.php
viewtopic.php
viewtopic.php<P> Test Run.