new to PHP, so I’m learning as I go about creating my websites.
what I’m trying to do is simply create a loop that will create the my buttons (an image for each button)
Here’s what I have, right now simply lists the text of Jan to Dec
<?
// foreach example - loop through each entry in an array
$month = array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
foreach ( $month as $element ) {
echo "$element , ";
}
?>
To create image buttons I use this code
<img class="imgLink btnArchive" src="/images/btnJan.jpg" onmouseover="(this.src)='/images/btnJan.jpg';" onmouseout="(this.src)='/images/btnJan.jpg';" alt="" />
So all I basically want to do is create a loop with the array that will change the image name with the name of the month to display all 12 buttons
I tried this, but I don’t know how to deal with quotations in php and adding array values into code
echo '<img class="imgLink btnArchive" src="/images/btn &element .jpg" onmouseover="(this.src)='/images/btn &element .jpg;"
onmouseout="(this.src)=/images/btn &element .jpg';" alt="" />'
Thanks very much