Skip to content

Instantly share code, notes, and snippets.

@muriloazevedo
Created September 26, 2014 23:54
Show Gist options
  • Save muriloazevedo/b8faf94dc92a0dae34b1 to your computer and use it in GitHub Desktop.
Save muriloazevedo/b8faf94dc92a0dae34b1 to your computer and use it in GitHub Desktop.
Exemplo de array_chunk
<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