Darkmatter5 Posted May 29, 2009 Share Posted May 29, 2009 How can you use print_r to display all the contents of an array, but put <br>'s or something after each element, instead of massing all the data into one continuous stream of output that is hard to decipher? Link to comment https://forums.phpfreaks.com/topic/160162-solved-help-with-print_r/ Share on other sites More sharing options...
JonnoTheDev Posted May 29, 2009 Share Posted May 29, 2009 print_r is for debugging but the easiest way is print "<pre>"; print_r($array); print "</pre>"; Link to comment https://forums.phpfreaks.com/topic/160162-solved-help-with-print_r/#findComment-845024 Share on other sites More sharing options...
Ken2k7 Posted May 29, 2009 Share Posted May 29, 2009 Or just view source. Link to comment https://forums.phpfreaks.com/topic/160162-solved-help-with-print_r/#findComment-845026 Share on other sites More sharing options...
Daniel0 Posted May 29, 2009 Share Posted May 29, 2009 [...] instead of massing all the data into one continuous stream of output that is hard to decipher? It doesn't. It makes new lines and indentation for you. Remember that PHP just outputs text and nothing else. If you give that text to a browser it will be interpreted (by default) as HTML. Link to comment https://forums.phpfreaks.com/topic/160162-solved-help-with-print_r/#findComment-845030 Share on other sites More sharing options...
Darkmatter5 Posted May 29, 2009 Author Share Posted May 29, 2009 Thank you neil.johnson!! Worked great!! Link to comment https://forums.phpfreaks.com/topic/160162-solved-help-with-print_r/#findComment-845119 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.