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"? Quote Link to comment 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'; } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.