View Single Post
Old 09-26-2008, 11:36 AM   #7 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

With the newer versions of PHP (5.3 I think) it's also possible to do:
PHP Code:
$items = array('item1''item2''item3''item4');

array_walk($items, function($item){
    echo 
'<li>'$item'</li>'PHP_EOL;
}); 
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
RobertK (09-26-2008)