Created
July 23, 2013 10:56
-
-
Save timohausmann/6061546 to your computer and use it in GitHub Desktop.
Algorithm: li article article li
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 | |
$length = count( $items ); | |
foreach( $items as $i => $item ) { | |
if( $i % 2 == 0 ) echo '<li>'; | |
echo '<article> ... </article>'; | |
if( $length-1 == $i || ($i+1) % 2 == 0 ) echo '</li>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment