note 97321 added to function.array-chunk
| From: | Anonymous at osu1 dot php dot net | Date: | Wed, 14 Apr 2010 14:09:52 +0000 |
| Subject: | note 97321 added to function.array-chunk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-168230@lists.php.net to get a copy of this message | ||
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
----
Server IP: 72.55.140.6
Probable Submitter: 24.203.100.200
----
Manual Page -- http://www.php.net/manual/en/function.array-chunk.php
Edit -- https://master.php.net/note/edit/97321
Del: integrated -- https://master.php.net/note/delete/97321/integrated
Del: useless -- https://master.php.net/note/delete/97321/useless
Del: bad code -- https://master.php.net/note/delete/97321/bad+code
Del: spam -- https://master.php.net/note/delete/97321/spam
Del: non-english -- https://master.php.net/note/delete/97321/non-english
Del: in docs -- https://master.php.net/note/delete/97321/in+docs
Del: other reasons-- https://master.php.net/note/delete/97321
Reject -- https://master.php.net/note/reject/97321
Search -- https://master.php.net/manage/user-notes.php