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

  • SEARCH
  • Home
  • 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 7928347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:42:23+00:00 2026-06-03T19:42:23+00:00

I have a multidimensional array with various sites links, here is output: Array (

  • 0

I have a multidimensional array with various sites links, here is output:

Array
(
    [0] => Array
        (
            [0] => http://www.msn.com/etc
            [1] => http://www.yahoo.com/etc
            [2] => http://www.google.com
        )

    [1] => Array
        (
            [0] => http://www.abc.com/etc
            [1] => http://www.hotmail.com/etc
            [2] => http://www.hotmail.com/page/2
        )

    [2] => Array
        (
            [0] => http://www.live.com/etc
            [1] => http://www.google.com/etc
            [2] => http://www.stock.com
        )

)

I wants to match multiple URL’s, here my example code:

$sites = array("msn.com","hotmail.com","live.com");
$links = array(
    array("http://www.msn.com/1","http://www.yahoo.com/etc","http://www.google.com"),
    array("http://www.msn.com/2","http://www.hotmail.com/","http://www.hotmail.com/page/2"),
    array("http://www.live.com/etc","http://www.google.com/etc","http://www.stock.com")
);

I need whatever sites are in $sites,first it will find msn.com site from $links array, so if it found msn.com in first array($links[0]) it will not search msn.com in other $links array but keep searching for other (hotmail.com and live.com), and if it find 2 links of same host in one array, it will join them, means if it finds a host in one array element it will not search that host in other elements of $links array, so final output from above will be this:

Array
(
    [msn] => Array
        (
            [0] => http://www.msn.com/1
        )

    [hotmail] => Array
        (
            [0] => http://www.hotmail.com/
            [1] => http://www.hotmail.com/page/2
        )

    [live] => Array
        (
            [0] => http://www.live.com/etc
        )

)

I am not sure how to perform this task, I would be grateful for any input. Thanks

  • 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-03T19:42:24+00:00Added an answer on June 3, 2026 at 7:42 pm

    best I’ll give you is pseudo code.

    for each of the links arrays
        for each of the non eliminated sites
            find all the matching entries in this link array, for this site
            if theres at least one match
                eliminate this site from the list
                store the matches into a results array indexed by sitename, 
                --for example $results[$sitename] = $matchesArray
    

    have fun

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

Sidebar

Related Questions

I have a multidimensional array with various config settings. Here's an example: $this->data =
I have a multidimensional array, here: $noticeDate = json_encode( $noticesDates ); and I want
I have a multidimensional array and want to break it down. Here's the array.
I have a multidimensional array with the following structure: teamMembers[teamMembers][0][Name]; teamMembers[teamMembers][0][Email]; teamMembers[teamMembers][1][Name]; teamMembers[teamMembers][1][Email]; etc.
I have a multidimensional array and I want to have the output that only
I have multidimensional array with many values, this is minimized version of it: $test
hi i have multidimensional array in php i want to remove an index from
I have a multidimensional array which, when echoed in PHP, looks like this: {
I have a multidimensional array. I need to search it for a specific range
I have an multidimensional array that looks like this: Array ( [0] => Array

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.