Created
September 26, 2014 23:54
-
-
Save muriloazevedo/b8faf94dc92a0dae34b1 to your computer and use it in GitHub Desktop.
Exemplo de array_chunk
This file contains 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
<div class="carousel-inner"> | |
<div class="item"> | |
<?php | |
$input_array = array('a', 'b', 'c', 'd', 'e'); | |
$carousel = array_chunk($input_array, 2); | |
foreach($carousel as $c): | |
?> | |
<div class="row"> | |
<?php foreach($c as $item):?> | |
<div class="col-md-3"></div> | |
<?php endforeach?> | |
</div> | |
<?php endforeach?> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment