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? Quote 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>"; Quote 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. Quote 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. Quote 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!! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.