Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8792489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:59:08+00:00 2026-06-13T22:59:08+00:00

How would I link each image in the array below to different pages? The

  • 0

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');            
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:59:09+00:00Added an answer on June 13, 2026 at 10:59 pm

    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:

        $links = array(
        'www.link01.com' => 'small_header_01.jpg',
        'www.link02.com' => 'small_header_02.jpg',
        'www.link03.com' => 'small_header_03.jpg',
        'www.link04.com' => 'small_header_04.jpg',
        'www.link05.com' => 'small_header_05.jpg',
    );
    

    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:

    foreach($links as $link => $image) {
        echo "<a href='http://{$link}'><img src='{$image}'></img></a><br />";   
    }
    

    Or you could use two arrays, one holding links, and the other one holding images, and then combine them.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my website I would like to compare two companies with an image-chart/-graph. Each
I have an html page full of images. Currently, each image is a link
I would like to add track code for each link of in my email
I've recently started developing a portfolio website which I would like to link to
I have an app which displays 10 images and each image is associated with
I would like to link to a specific section of a report from another
I wanted to create a link that would show content before showing a direct
I am creating a Google Chrome extension where it would grab the link of
How would I add a link to my menu item in wxpython? What I
I would like to keep first link as default selected with javascript, here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.