|
Posted by Koncept on 12/01/06 23:58
In article <1165008839.175383.69950@79g2000cws.googlegroups.com>,
<catmansa@gmail.com> wrote:
> Good afternoon, I have a $data array which may contain 1-25 records. I
> want to print them out, 5 per line. How would I properly do that? :)
>
Maybe something like this...
<?php
$array = range(1,25);
$chunked = array_chunk( $array, 5);
foreach($chunked as $a){
echo join(", ",$a),"<br />\n";
}
?>
--
Koncept <<
"The snake that cannot shed its skin perishes. So do the spirits who are
prevented from changing their opinions; they cease to be a spirit." -Nietzsche
Navigation:
[Reply to this message]
|