Re: Arrays
| From: | Dan | Date: | Tue, 11 Jun 2002 01:36:08 +0000 |
| Subject: | Re: Arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-101486@lists.php.net to get a copy of this message | ||
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
>
>