unemployment Posted February 26, 2011 Share Posted February 26, 2011 how do I echo "blah" after the first loop in a foreach loop and the in the rest of them echo "crazy"? Link to comment https://forums.phpfreaks.com/topic/228958-first-foreach-loop/ Share on other sites More sharing options...
sasa Posted February 26, 2011 Share Posted February 26, 2011 try <?php $test = range(1,10); $text = 'blah'; foreach($test as $n){ echo "$n - $text<br />\n"; $text = 'crazy'; } ?> Link to comment https://forums.phpfreaks.com/topic/228958-first-foreach-loop/#findComment-1180147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.