paulman888888 Posted July 15, 2008 Share Posted July 15, 2008 I dont know how to do loops. I tryed print_r but that was very not very neat. I would like each one on a new line. Thankyou Paul Link to comment https://forums.phpfreaks.com/topic/114878-what-is-the-best-way-show-an-array/ Share on other sites More sharing options...
kenrbnsn Posted July 15, 2008 Share Posted July 15, 2008 Learn how to do loops. <?php $ary = range(0.9,1.3,0.1); for ($i=0;$i<count($ary);$i++) echo $ary[$i] . '<br>'; // // or // foreach ($ary as $ele) echo $ele . '<br>'; ?> To make print_r look better, do <?php echo '<pre>' . print_r($ary,true) . '</pre>'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/114878-what-is-the-best-way-show-an-array/#findComment-590743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.