I'm pretty new to PHP and am looking into using [array\_chunk()](http://www.php.net/manual/en/function.array-chunk.php) to split an array into three parts to display it as a three column list. Let's say I have an array like this

```
 $input_array = array('a', 'b', 'c', 'd', 'e', 'f');
 $chunks = array_chunk($input_array, 3, true));

```

and I want to output something like:

```
<div class="left">
 <ul>
  <li>a</li>
  <li>b</li>
 </ul>
 </div>

<div class="middle">
 <ul>
  <li>c</li>
  <li>d</li>
 </ul>
 </div>

<div class="right">
 <ul>
  <li>e</li>
  <li>f</li>
 </ul>
</div>

```

I've seen some [really helpful examples](https://stackoverflow.com/questions/9478973/php-list-structure/9479029#9479029) on here but none that show how to foreach loop each chunk of the original array to place where you need within your html/css.

Is this a job for array\_slice? But what if my array is dynamically populated and I don't know how big it will be at a given time?

Thanks!