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 3320190
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:54:50+00:00 2026-05-17T22:54:50+00:00

In regard to my question here , Jacob Relkin suggested a great solution of

  • 0

In regard to my question here, Jacob Relkin suggested a great solution of using call_user_func_array. That solved my problem but now I am really curious on how to do this in the absence of this function to achieve what I wanted in my original question which is below for reference:

Original Question:

I am creating an array of arrays in the following way:

$final_array = array();
for($i = 0; $i < count($elements); $i++) {
    for($j = 0; $j < count($elements); $j++) {
        if($i!=$j)
            $final_array[] = array_intersect($elements[$i], $elements[$j]);
    }
}

I am trying to find out the list of elements that occur in all the arrays inside the $final_array variable. So I was wondering how to pass this to array_intersect function. Can someone tell me how to construct args using $final_array[0], $final_array[1], ... $final_array[end_value] for array_intersect? Or if there is a better approach for this, that would be great too.

I am looking for a way to construct the following:

array_intersect($final_array[0], $final_array[1], $final_array[2], ...)

  • 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-05-17T22:54:51+00:00Added an answer on May 17, 2026 at 10:54 pm

    Well, the only real way to do this other than call_user_func_array would be to implode the resulting array into comma-separated arguments, then do something really really evil and use eval:

    $args_imploded = implode(',', $some_array);
    
    $result = eval('return array_intersect(' . $args_imploded . ')');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My first question here, hopefully I'm not doing it wrong. My problem is that
This is mainly in regards to my question here , but I don't understand
This feels like an extremely n00b question, but here goes... I have a series
I have a django form that I'm outputing no problem. My question is with
I'm pretty sure this is a simple question in regards to formatting but here's
possible noob question but humor me here... I get at least two xml files
I might be an idiot here but I have a question regarding xpages and
I realise there are a fair few questions on here already with regard to
My question is in regard to the SelectComman in the <asp:SqlDataSource ID=SqlDataSource2 runat=server ConnectionString=<%$
My question is in regard to the way Java handles String literals. It's quite

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.