Created
October 10, 2016 11:37
-
-
Save hsleonis/b8ba6c59550ef417dbfded24a16fd1da to your computer and use it in GitHub Desktop.
Prints two row with single items
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 | |
| // Items | |
| $n = 18; | |
| $iterator = ($n>4)?2:1; | |
| echo '[ CONTAINER ]<br />'; | |
| for($i=0;$i<$n;$i+=$iterator){ | |
| echo '[ * col * ]'; | |
| echo "{ item ".($i)." }"; | |
| if(($n==5 && $i==2) or ($n==6 && $i==4)) { | |
| $iterator=1; | |
| echo '[ * /col * ]<br />'; | |
| continue; | |
| } | |
| if($iterator==2 && $i+1<$n) echo "{ item ".($i+1)." }"; | |
| echo '[ * /col * ]<br />'; | |
| } | |
| echo '[ /CONTAINER ]'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment