This topic is locked

Need help with foreach loop

12/16/2008 7:53:22 PM
PHPRunner General questions
L
Lorenbond author

The following foreach loops 7 cycles through 7 fields.
I would like it to stop after the 2nd cycle.
**##foreach @BUILDER.Registration.arrUserFields as @f##
$label = "##Fields[strName==@f].strLabel s##";

$message.=$label.": ".$values["##@f s##"]."\r\n";

endfor##**



Any help with this simple re-write would be appreciated.

R
ringah 12/28/2008

The following foreach loops 7 cycles through 7 fields.

I would like it to stop after the 2nd cycle.
**##foreach @BUILDER.Registration.arrUserFields as @f##
$label = "##Fields[strName==@f].strLabel s##";

$message.=$label.": ".$values["##@f s##"]."\r\n";

endfor##**



Any help with this simple re-write would be appreciated.


Try this..
i=0

While (i<3){
insert your code to exec here

i=i+1
}