Jump to content

array data echo into table


hsub

Recommended Posts

hi all,

i can't seem to figure out how to do this.

below is a bit of code that sort through an array and return the 3 highest value.

i would like to then take those three values and place them separately into the <div id> tags.

 

<?

$array = array(5, 8694, 13,5,46,84,9,48684,8642,54,3,664,87,93,24,56,487,9341,8432);

rsort($array);

for($i = 0; $i < 3; $i++) // Only loop 10 times.

echo $array[$i] . "<br>";

?>

 

<div id="container">

  <div id="left"> <?php  echo $highest?></div>

 

<div id="center"><?php  echo $secondhighest; ?></div>

 

<div id="right"><?php  echo $thirdhighest; ?></div>

</div>

 

thank you in advance for any help on this.

Link to comment
https://forums.phpfreaks.com/topic/135521-array-data-echo-into-table/
Share on other sites

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.