Get the number of items in the array using the count function and then use a
for statement to loop through them from start to finish.  Here's an example:

$Total = count($link);

for ($i = 0;$i < $Total;$i++)
        print "<li><a href='".$link[$i]."'>$name</a></li>";

Of course, the link names will all be the same, so you'll probably want to
store that in the array as well...

for ($i = 0;$i < $Total;$i++)
        print "<li><a

-----Original Message-----
From: Dan [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 3:01 PM
Subject: [PHP] Arrays

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

Daniel Broome, siliconBLUE Ltd, Web Author,
Mob: 64-21-178-5120

PHP General Mailing List (
To unsubscribe, visit:
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law.  If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message.  If you have received this message in error, please immediately
advise the sender by reply email and delete the message.  Thank you very

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to