tjmbc Posted June 2, 2008 Share Posted June 2, 2008 i have an array that I used explode() on to break it up into variables i can echo each variable by calling it with $variable[0] then $variable[1] but how do I print all of the variables without calling each one individually? i'm guessing its something like while(???some sort of code to that i don't know???) { echo $variable; } Quote Link to comment Share on other sites More sharing options...
trq Posted June 2, 2008 Share Posted June 2, 2008 <?php $arr = array('foo','bar','bob'); foreach ($arr as $k) { echo $k."\n"; } ?> 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.