note 97321 deleted from function.array-chunk by danbrown
| From: | danbrown@php.net | Date: | Wed, 14 Apr 2010 14:18:14 +0000 |
| Subject: | note 97321 deleted from function.array-chunk by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168231@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
function chunkarray($the_array_to_be_chunked, $chunk_after_this_number)
{
$array_lenght = array_chunk($the_array_to_be_chunked, $chunk_after_this_number);
print "<table border=\"1\" cellpadding=\"2\">\n";
foreach ($array_lenght as $array_break) {
print "<tr>\n";
foreach ($array_break as $array_result) {
print "<td>" . $array_result . "</td>\n";
}
print "</tr>\n";
}
print "</table>\n";
}
chunkarray($yourarray, 3); // This example: if your array return 12 results, the table will be 3
cells width, 4 rows height