This snippet will create a unordered HTML list out of the array elements. You can put anything in this array what you want to appear in the list.
// Fill a array with values
$level = array('List item 1', 'List item 2', 'List item 3');
/*
* echo the start(open) unordered HTML element
* After that, loop through each array element
* For the closure, echo the closing unordered HTML element
*/
echo '<ul>';
foreach ($level as $item)
{
echo '<li>'. $item .'</li>';
}
echo '</ul>';
Mail this!
- Comments (0)
- PingBacks (0)
- TrackBacks (0)

» Latest comments