willpower Posted March 2, 2006 Share Posted March 2, 2006 if I have an array $resulthow do I echo all the contents?$result[1], $result[2]..etc Quote Link to comment https://forums.phpfreaks.com/topic/3912-array/ Share on other sites More sharing options...
marker5a Posted March 2, 2006 Share Posted March 2, 2006 print_r($array) works great for meor...You could also doforeach($array as $value){echo "$value, ";} Quote Link to comment https://forums.phpfreaks.com/topic/3912-array/#findComment-13545 Share on other sites More sharing options...
obsidian Posted March 2, 2006 Share Posted March 2, 2006 [!--quoteo(post=350959:date=Mar 2 2006, 09:27 AM:name=marker5a)--][div class=\'quotetop\']QUOTE(marker5a @ Mar 2 2006, 09:27 AM) [snapback]350959[/snapback][/div][div class=\'quotemain\'][!--quotec--]print_r($array) works great for me[/quote]yep, and it's really helpful to put it within <pre> tags, too:[code]echo "<pre>\n";print_r($array);echo "</pre>\n";[/code] Quote Link to comment https://forums.phpfreaks.com/topic/3912-array/#findComment-13546 Share on other sites More sharing options...
kenrbnsn Posted March 2, 2006 Share Posted March 2, 2006 You can do the last suggestion in one line:[code]<?php echo '<pre>'.print_t($array,true).'</pre>'; ?>[/code]Ken Quote Link to comment https://forums.phpfreaks.com/topic/3912-array/#findComment-13563 Share on other sites More sharing options...
willpower Posted March 2, 2006 Author Share Posted March 2, 2006 Thank you all... Quote Link to comment https://forums.phpfreaks.com/topic/3912-array/#findComment-13601 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.