View Single Post

  #3 (permalink)  
Old 05-08-2008
SM
 
Posts: n/a
Default Re: For loop question?

On May 8, 3:24 pm, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote:
> SM wrote:
> > $cat_1 = array('moonlight.jpg'', shadow.jpg', 'luna.jpg');

>
> > for($i=0; ...){

>
> Don't.
>
> When iterating through arrays, *always* use foreach().
>
> --
> ----------------------------------
> Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> Now listening to: Anggun - Au nom de la lune (1997) - [7] La Mémoire des
> rochers (4:03) (74.500000%)


I'm using the for loop for pagination not to iterate throught the
array. I've only created this example for demonstration purposes. The
idea what to learn how to get the values of the array if the array was
define in a variable?

Any ideas, anyone?

Thanks
Marco
Reply With Quote