Re: PHP Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paulo Work wrote:
> Hello my name is Paulo Carvalho and I am struggling with the following:
> 
> I am building a website with basic CMS functionality.
> My problem is that in one of the pages I am using Easyslider to display
> small comments about the clients.
> 
> These comments are divided in 3 per slide.
> ex:(<li>
> <p>comment 1/p>
> <p>comment 1/p>
> <p>comment 1/p>
> </li>)
> 
> Now I am struggling with the following:
> I am pulling the comments from the db and I would like to know if i can
> split that array in 3's (array_slice) perhaps?
> 
> My goal is to within a foreach loop output 3 comments within a
> slide(wrapped in <li>), so first 3 would output:
> 
> (<li>
> <p>comment 1/p>
> <p>comment 2/p>
> <p>comment 3/p>
> </li>)
> Then another 3
> 
> (<li>
> <p>comment 4/p>
> <p>comment 5/p>
> <p>comment 6/p>
> </li>)
> Thank in advance for all the replies.
> Paulo carvalho
> 

This looks like a job for modulo man.

I was hoping to simply give you a list of examples from google, but I couldn't
find any that showed exactly what you were trying to do, so... I wrote this
article for my site.  Let me know if you have any questions.

http://www.bendsource.com/phpModulo


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux