Jump to content

[SOLVED] 50% loop


nathanmaxsonadil

Recommended Posts

Maybe:

<style>
#div1, #div2 {
    width: 200px;
    float: left;
}

</style>

<?php

$max_loops = 10;
$half_way = $max_loops/2;

echo '<div id="div1">';

for($i = 1; $i <= $max_loops; $i++)
{
    echo $i . '<br />';

    if($i == ceil($half_way)) echo '</div><div id="div2">';

}

echo '</div>';

?>

Link to comment
https://forums.phpfreaks.com/topic/69373-solved-50-loop/#findComment-348570
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.