$WBFOREACH - loop through array elements

Availability
$WBFOREACH is available for use with all WBSP commands.

Syntax
$WBFOREACH{VarName|ArrayName|Content}
$WBFOREACH[VarName|ArrayName|Content]

Parameters
VarName - the name of the variable used to iterate through the elements of the ArrayName . The variable can be accessed using $WBGETV function (see the example)
ArrayName- the name of an array.
Content - block of code (including WhizBase elements) that will be repeated through the loop

Returns
Code contained in content repeated through the loop.

Example

<!--
[FormFields]
wb_command=r
-->
<!--WB_BeginTemplate-->
<html>
<head>
  <title>WBFOREACH</title>
</head>
<body>
$WBSPLIT[Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday|Days|,]
$wbforeach[Day|Days|$wbfn[ucs($wbgetv[Day])]<br>]
</body>
</html>

After running this example, the resulting page in browser, should look like this:

MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY