Re: Looping?

From: Date: Fri, 14 Dec 2001 12:50:14 +0000
Subject: Re: Looping?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-77735@lists.php.net to get a copy of this message
How can I make the following work: function start($times) {
       for...loop starts here...
       {  <-- notice only one bracket.
} function end() {
       } <-- the ending bracket.
} start('10'); html-code... I want this to be repeated 10 times. end();
Try instead: function MakeLoop($loops, $htmlcode) { for($i=0; $i<$loops; $i++) {
       echo $htmlcode;
} } MakeLoop(10); Dont know if you can use this? Else, try to tell a bit more about what solution you want? /Johan

« previous php.general (#77735) next »