I am counting the number of results in each array first and then print them like this:
if ($array_count == '12'){
$output = '<div class="row">';
$cat_array = array_chunk((array)$cat_array, 3);
foreach($cat_array as $column) {
$output .= '<div class="col-xs-3">';
foreach ($column as $row) {
$output .= '<div class="row"><div class="col-xs-12"><small><a href="' .
$row['subcat_link'] . '" class="cat_filter_link">' . $row['name'] . '</a></small></div></div>';
}
$output .= '</div>';
}
$output .= '</div>';
}
In that case, I am putting 3
into each chunk. Is there any easy way to define, if possible, that I want 4 chunks of 5,3,2,2?