Jump to content

add breakline in for loop which is in foreach


salgergawi
 Share

Recommended Posts

how can i add a breack line using for loop in an foreach

i have written this code but i know it is wrong

 

<?php
    if($reginoal_own_units<>0){
        $total_regional_units +=$reginoal_own_units;
        $count++;
        for ($i = 0; $i <= count($countries); $i+=3) {
           if ($i % 3 == 0){
                $break_line = "<br>";
            }
        }
        echo $countryname . " ( " .$reginoal_own_units . " ) ".round($regional_calc,0)."" . $break_line;
    }
?>

Edited by salgergawi
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...