Jump to content

What is the best way show an array?


paulman888888

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.