note 33723 added to function.system
| From: | unlrn at chaospunks dot com | Date: | Sat, 05 Jul 2003 06:28:50 +0000 |
| Subject: | note 33723 added to function.system | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51545@lists.php.net to get a copy of this message | ||
I'm not sure if this is an oddity with system() or my misuse of it's syntax, but I noticed
some strange behavior. I was using system to execute a fortune command to display a random fortune
on a webpage. Using system the following code worked, but often produced a duplicate of the last
line. I'm not sure if it was the last line or more or less, but here is an example:
$quote = system('fortune');
echo $quote;
COMMENT Oh, life is a glorious cycle of song, A medley of extemporanea; And love is thing that can
never go wrong; And I am Marie of Roumania. -- Dorothy Parker -- Dorothy Parker
Don't get even -- get odd! -- get odd!
Replacing the call to system with backticks made this odd behavior go away.
----
Manual Page -- http://www.php.net/manual/en/function.system.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33723
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33723&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33723&report=yes