|
Posted by stefano.troiani@gmail.com on 10/24/06 09:08
Rik wrote:
> stefano.troiani@gmail.com wrote:
> > Hi,
> >
> > i have two arrays and I would like to loop both of them one inside the
> > other.
> > The first one comes from a readdir and present an array with the
> > document's names, the second one is an array with the names i want to
> > appear for that documents as a link.
> > My need is to sort both of them so that i got something like this:
> > <a href="first element of array 1" > first element of array 2</a>
> > <a href="second element of array 1" > second element of array 2</a>
> > .........................................
> >
>
> How exactly are you linking the document names and descriptions?
> If link them purelay on the numerical indexes in both arrays, with one to
> one relations, try:
>
> $combined = array_map(null,$files,$desciptions);
> foreach($combined as $link){
> vprintf('<a href="%s">%s</a>',$link);
> }
> --
> Grtz,
>
> Rik Wasmus
Thanks!!! this is what I was looking for :)
stefano
[Back to original message]
|