You are here: Re: Question about breaking data up « All PHP « IT news, forums, messages
Re: Question about breaking data up

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация