note 79849 added to language.functions

From: Date: Sat, 15 Dec 2007 10:07:13 +0000
Subject: note 79849 added to language.functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-133534@lists.php.net to get a copy of this message
Running many functions on a variable with foreach array iterator. <?php function f1($var){ $var .= '1'; // dosomethingwith($var) echo $var; } function f2($var){ $var .= '2'; // dosomethingelsewith($var) echo $var; } function f3($var){ $var .= '3'; // dosomethingsame($var) echo $var; } $taskA_functions = array('f1','f2'); $taska = ' taskA'; $taskB_functions = array('f1','f3'); $taskb = ' taskB'; foreach($taskA_functions as $f){ $f($taska); } foreach($taskB_functions as $f){ $f($taskb); } ?> Above returns: taskA1 taskA2 taskB1 taskB3 Lazar -- http://www.inverudio.com ---- Server IP: 64.71.164.2 Probable Submitter: 24.136.17.152 ---- Manual Page -- http://www.php.net/manual/en/language.functions.php Edit -- https://master.php.net/note/edit/79849 Del: integrated -- https://master.php.net/note/delete/79849/integrated Del: useless -- https://master.php.net/note/delete/79849/useless Del: bad code -- https://master.php.net/note/delete/79849/bad+code Del: spam -- https://master.php.net/note/delete/79849/spam Del: non-english -- https://master.php.net/note/delete/79849/non-english Del: in docs -- https://master.php.net/note/delete/79849/in+docs Del: other reasons-- https://master.php.net/note/delete/79849 Reject -- https://master.php.net/note/reject/79849 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133534) next »