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 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, ";} 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] 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 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... Link to comment https://forums.phpfreaks.com/topic/3912-array/#findComment-13601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.