RE: [PHP] Re: Arrays
| From: | John Holmes | Date: | Tue, 11 Jun 2002 01:51:46 +0000 |
| Subject: | RE: [PHP] Re: Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101488@lists.php.net to get a copy of this message | ||
$echo .= "<li><a href='". $link ."'>". $name
."</a></li><br>";
Notice the . in .=
Equivalent of saying $echo = $echo . "<li><a href='". $link
."'>". $name
."</a></li><br>";
---John Holmes...
> -----Original Message-----
> From: Dan [mailto:danielb@siliconblue.com]
> Sent: Monday, June 10, 2002 9:36 PM
> To: php-general@lists.php.net
> Subject: [PHP] Re: Arrays
>
> I have figured out how to do it thanks for you guys help..
>
> Just one thing...
>
> <?
> $contact = array( 'moreinfo.php' => 'More Info'
> , 'contact.php' => 'Contact Us'
> , 'apage.php' => 'A Page'
> );
> foreach ($contact as $link => $name)
> {
> echo "<li><a href='". $link ."'>". $name
> ."</a></li><br>";
> }
> ?>
>
> What I need to do now is in the echo string is make use something
like:
>
> $echo = "<li><a href='". $link ."'>". $name
> ."</a></li><br>";
>
> I have tryed doing it this way but it will only desplay one array when
I
> call $echo down the page.
>
> What can I do to desplay all of them?
>
>
> "Dan" <danielb@siliconblue.com> wrote in message
> news:20020610220459.43425.qmail@pb1.pair.com...
> > I'm trying to get my head around arrays and how to munipulate them.
> >
> > what I need to do is add html around the arrays eg.
> > <li><a
> > href='".$link(0)."'>".$name."</a></li>;
> >
> > I have my head around that but I the number of lines the I need to
> create
> is
> > going to change so I need the script to repeat untill all the arrays
are
> > used.
> >
> > --
> > -----------------------------------------
> > Daniel Broome, siliconBLUE Ltd, Web Author,
> > http://siliconblue.com
> > Mob: 64-21-178-5120
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php