create a two dimensional array from simple array for csv use
<p>to create a csv file with php, the expected input is a two dimensional array, so as 1 row = 1 internal array.</p>

<pre><code>$list = array (
    array('aaa', 'bbb', 'ccc', 'dddd'),
    array('123', '456', '789'),
    array('"aaa"', '"bbb"')
);

$fp = fopen('file.csv', 'w');

foreach ($list as $fields) {
    fputcsv($fp, $fields);
}

fclose($fp);

//output result in file.csv

aaa,bbb,ccc,dddd
123,456,789
"""aaa""","""bbb"""
</code></pre>

<p>so i have the following array:</p>

<pre><code>$list = array('item1','item2','item3','item4','item5','item6');
</code></pre>

<p>i need to take this array and break it into smaller arrays within 1 array for the csv.  Each small array needs to have '999999' at index 0, followed by the next two items in the <code>$list</code> array.  So the final result would be like this:</p>

<pre><code>$newList = array( array(999999, "item1" , "item2"),
               array(999999, "item3" , "item4"),
               array(999999, "item5" , "item6")
             ); 
</code></pre>

<p>the original list array may contain up to 100 values at sometimes.  What is the best way to achieve this?</p>
