note 34762 added to function.exec

From: Date: Wed, 06 Aug 2003 00:16:14 +0000
Subject: note 34762 added to function.exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-53469@lists.php.net to get a copy of this message
Not sure if this has any sort of negative security implication but when trying to return multiple lines of output (and being unsuccessful) I stumbled across this: $command = "file -i myfile.txt"; $output = $command; echo $output; Works nicely to capture more than one line of output without dumping it to the browser. Notice on line #2 I am using ` and not ' or ". Use with caution!! ---- Manual Page -- http://www.php.net/manual/en/function.exec.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34762 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34762&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34762&report=yes

« previous php.notes (#53469) next »