note 69099 deleted from function.system by bjori

From: Date: Wed, 23 Aug 2006 07:44:34 +0000
Subject: note 69099 deleted from function.system by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-116216@lists.php.net to get a copy of this message
Note Submitter: haccel at email dot com ---- RE: Bill at KilgallonFamily dot com. I can see your problem. This is working as expected. You're using $resultStatus for both of the different types of results you can obtain here (last line of program output or the Int status). As we exec from right to left, the Int $resultStatus is being being over-written with the String output of the program. Your code: <?php $resultStatus = system('/bin/ls /foo', $resultStatus); print "$resultStatus"; ?> Should be: <?php $resultStatus = system('/bin/ls /foo', $intStatus); print "$intStatus"; ?> or can also be: <?php system('/bin/ls /foo', $resultStatus); print "$resultStatus"; ?>

« previous php.notes (#116216) next »