How would I link each image in the array below to different pages?
The array displays various banners on the website. I want each banner to link to a different page on the website.
for example small_header_01.jpg links to aboutus.html
$banner_small_images = array('small_header_01.jpg',
'small_header_02.jpg',
'small_header_03.jpg',
'small_header_04.jpg',
'small_header_05.jpg');
To build a link, you need a link location right? And your array does not provide link location. But you can fix that.
To do this you can build array like this:
Now you have array that holds image with appropriate link location. You stored you link location in array key, and image location in array value.
From there you can loop through all array items and print your links like this:
Or you could use two arrays, one holding links, and the other one holding images, and then combine them.
Hope this helps!