It's not obvious what language You mean, but I think this will work for you:

$aDistrict = array('part1','part2','part3','part4');
foreach($aDistrict as $sDistrict)
{
 echo '<a href="page.htm#',$sDistrict,'">',$sDistrict,"</a>\n";
}

Note: I'm using single quotes for some of the string chunks to eliminate the
multiple backslashes for the double quotes. I'm also using commas to echo
the 5 parts in sequence, rather than concatenate them then echo the result.


> -----Original Message-----
> From: John Taylor-Johnston [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 23, 2004 7:58 PM
> To: [EMAIL PROTECTED]
> Cc: John Taylor-Johnston
> Subject: [PHP] enum('part1','...')
>
>
> Basically I have an enum field. I would like to extract the parts
> of the field to create some html.
>
> district enum('part1','part2','part3','part4')
>
> while (district??)
> {
> echo "<a href=\"page.htm#".district[0]."\">".district[0]."</a>
> }
>
> <a href="page.htm#part1">part1</a>
> <a href="page.htm#part2">part2</a>
> <a href="page.htm#part3">part3</a>
> <a href="page.htm#part4">part4</a>
>
> Can I even do this? How?
>
> J
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to