note 42567 added to function.system

From: Date: Fri, 21 May 2004 16:56:26 +0000
Subject: note 42567 added to function.system
Groups: php.notes 
Request: Send a blank email to php-notes+get-69916@lists.php.net to get a copy of this message
It's important to note that if you are running a series of system() commands in a loop, you need to include the second argument in order for them to run synchonously. ie) // this will execute process.php asynchronously; not waiting for completion before executing the next one. $array = array('apple', 'banana', 'pear'); foreach($array as $i) { system("php process.php \"fruit=$i\""); } // this will execute process.php 3 times, waiting for the prior command to complete before starting a new one $array = array('apple', 'banana', 'pear'); foreach($array as $i) { system("php process.php \"fruit=$i\"", $status); } ---- Manual Page -- http://www.php.net/manual/en/function.system.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42567 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42567&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42567&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#69916) next »