note 22154 added to function.shell-exec

From: Date: Sat, 08 Jun 2002 09:41:12 +0000
Subject: note 22154 added to function.shell-exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-31598@lists.php.net to get a copy of this message
If you want to execute a command, and then output it as it would look in a terminal, with newlines and all, do this: $output = shell_exec($command); $output = str_replace("\xa","<br>",$output); echo($output); This will make it substitute the newlines for <br> tags, so you get a normal output. :) -- http://www.php.net/manual/en/function.shell-exec.php http://master.php.net/manage/user-notes.php?action=edit+22154 http://master.php.net/manage/user-notes.php?action=delete+22154 http://master.php.net/manage/user-notes.php?action=reject+22154

« previous php.notes (#31598) next »