LemonInflux Posted May 30, 2008 Share Posted May 30, 2008 I have this php code: <?php for($i=0;$i<30;$i+3){ echo ('<tr><td>'.$letter[$].'</td><td>'.$letter[$i+1].'</td><td>'.$letter[$i+2].'</td></tr>'); } ?> Basically, it displays: <tr><td>Value 1</td><td>Value 2</td><td>Value 3</td></tr> <tr><td>Value 4</td><td>Value 5</td><td>Value 6</td></tr> Until it reaches value 30 (Excuse any errors, it's just for example's sake). My question is, is there a way to replicate this in smarty? Thanks in advance Link to comment https://forums.phpfreaks.com/topic/108034-smarty-for-loops/ Share on other sites More sharing options...
LemonInflux Posted May 30, 2008 Author Share Posted May 30, 2008 Too late to change it, but I spotted an error: echo ('<tr><td>'.$letter[$].'</td><td>'.$letter[$i+1].'</td><td>'.$letter[$i+2].'</td></tr>'); should be echo ('<tr><td>'.$letter[$i].'</td><td>'.$letter[$i+1].'</td><td>'.$letter[$i+2].'</td></tr>'); Link to comment https://forums.phpfreaks.com/topic/108034-smarty-for-loops/#findComment-553736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.