Jump to content

banner in array


Pauls74462

Recommended Posts

$banner_scr[0]="http://www.MyWebSite.com/image-3048586_94830485" alt="My Photo" border="0" height="125" width="125">;How do I get this array to work with this code:<img src=\"$banner_src[$which_banner]\" border=\"0\"></a></center>";
the error I'm getting is:Parse error: syntax error, unexpected T_STRING in /home/mywebsite/public_html/TestBanner/index.php on line 10That error is in the $banner_src[0] line
Link to comment
Share on other sites

the error I'm getting is:Parse error: syntax error, unexpected T_STRING in /home/mywebsite/public_html/TestBanner/index.php on line 10That error is in the $banner_src[0] line
The reason you get that error is because you haven't escaped your quotes. You could do it like dsonesuk has it with single quotes or escape your double quotes:dsonesuk's way:$banner_src[0]='<img src="http://www.MyWebSite.com/image-3048586_94830485" alt="My Photo" border="0" height="125" width="125">';or escape double quotes:$banner_src[0]="<img src=\"http://www.MyWebSite.com/image-3048586_94830485\" alt=\"My Photo\" border=\"0\" height=\"125\" width=\"125\">";Actually you could also use single quotes inside your doubles:$banner_src[0]="<img src='http://www.MyWebSite.com/image-3048586_94830485' alt='My Photo' border='0' height='125' width='125'>";
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...