I am trying to increase the number of variables in the following code:
<?php
$MenuLeft = array(
"CCPI"=> "ccpi.coleclan.net",
"Coasters"=> "coasters.coleclan.net",
"COD"=> "cod.coleclan.net",
"Convert"=> "convert.coleclan.net");
echo "<body bgcolor=\"#000000\" text=\"#FFFFFF\">";
foreach($MenuLeft as $MenuItem=>$MenuLink)
{
print "<a href=\"http://$MenuLink\" style=\"color:#ffffff; text-decoration:none\"
onMouseOver = \"rollover('$MenuItem')\"
onMouseOut = \"rollout('$MenuItem')\"
><img border=\"0\" src=\"./images/head_bullet_blank.gif\" alt=\"*\" name=\"$MenuItem\"
> $MenuItem</a><br>";
}
?>
So far this works fine.. However, I want to add a couple of things to appear right after the link outside of the <a> tags...
e.g. : CCPI NEW!
I figured the only good way to implement this in my layout that is used in the end product would to be to add to the array definitions.
I thought that increasing the length (adding what i need) would allow me to what i need. Here is what I tried...:
<?php
$MenuLeft = array(
"CCPI"=> "ccpi.coleclan.net",
"Coasters"=> "coasters.coleclan.net"=> "New!",
"COD"=> "cod.coleclan.net",
"Convert"=> "convert.coleclan.net");
echo "<body bgcolor=\"#000000\" text=\"#FFFFFF\">";
foreach($MenuLeft as $MenuItem=>$MenuLink=>$NewQ)
{
print "<a href=\"http://$MenuLink\" style=\"color:#ffffff; text-decoration:none\"
onMouseOver = \"rollover('$MenuItem')\"
onMouseOut = \"rollout('$MenuItem')\"
><img border=\"0\" src=\"./images/head_bullet_blank.gif\" alt=\"*\" name=\"$MenuItem\"
> $MenuItem</a>$NewQ<br>";
}
?>
but i get this error when i use that code...
[code]
Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting ')' in /var/www/coleclan/testing/new/arraytest.php on line 5
So... how do i properly do this?
What i want to get back to is something that allows me to "tack-on" a little image/link to the right of selected links that are generated using the array bit.
For example... in my old layout ( http://coleclan.net/_baks/previous_index_system/index.php )
(and i know the images are broken) i would add on to the end of the link a image/link if it were say a new item or if there was a search function related to the subdomain, i could drop it in. Looked neat, i liked it.
Obviously i am noobing here, but i have not played with Arrays for too long.... learning it!
Thanks!