note 108068 added to function.exec
| From: | cristian dot gabbanini at gmail dot com | Date: | Mon, 26 Mar 2012 18:56:36 +0000 |
| Subject: | note 108068 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-186825@lists.php.net to get a copy of this message | ||
In case you need to sequentially execute multiple commands, it is useful to do something like the
following instead of launching multiple times the exec function:
<?php
$cmd = name of the command to be executed;
$array = array containing values to cycle;
$s = sizeof($array);
$commandString = '';
while($s--){
//Here you should perfomr any needed operation
$commandString .= "$cmd;";
}
exec($commandString);
?>
----
Server IP: 69.147.83.197
Probable Submitter: 78.12.72.148
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- https://master.php.net/note/edit/108068
Del: integrated -- https://master.php.net/note/delete/108068/integrated
Del: useless -- https://master.php.net/note/delete/108068/useless
Del: bad code -- https://master.php.net/note/delete/108068/bad+code
Del: spam -- https://master.php.net/note/delete/108068/spam
Del: non-english -- https://master.php.net/note/delete/108068/non-english
Del: in docs -- https://master.php.net/note/delete/108068/in+docs
Del: other reasons-- https://master.php.net/note/delete/108068
Reject -- https://master.php.net/note/reject/108068
Search -- https://master.php.net/manage/user-notes.php