Created
January 12, 2018 07:48
-
-
Save MrShennawy/8734d39deefcfd2c38a045ca62ebc6b9 to your computer and use it in GitHub Desktop.
how to get custom number of items in the same row at every loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arr = ['a','b','c','d','f','g']; | |
$a = 0; | |
foreach ($arr as $value) { | |
// 3 it's number of items | |
if($a % 3 == 0){ | |
echo "<br>"; | |
} | |
echo $value; | |
$a++; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment