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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:03:11+00:00 2026-06-17T04:03:11+00:00

i have an multidimensioanl array which can increase based on user input.i want to

  • 0

i have an multidimensioanl array which can increase based on user input.i want to do array_intersect inside the array to get the common values between the key.

like example

Array ( [php] => Array ( [0] => 36 [1] => 51 [2] => 116 [3] => 171 [4] => 215 [5] => 219 [6] => 229 [7] => 247 [8] => 316 ) [java] => Array ( [0] => 14 [1] => 16 [2] => 19 [3] => 24 [4] => 25 [5] => 26 [6] => 29 [7] => 31 [8] => 33 [9] => 34 [10] => 35 [11] => 36 [12] => 37 [13] => 40 [14] => 45 [15] => 49 [16] => 51 ) ) 

expected output should be like (36,51)

and this is i am able to get it

via this,

$intersected_array = call_user_func_array('array_intersect', $array);

but if my array had a third key also which doesnot had a common value in all three of them

like

Array ( [php] => Array ( [0] => 36 [1] => 51 [2] => 116 [3] => 171 [4] => 215 [5] => 219 [6] => 229 [7] => 247 [8] => 316 ) [java] => Array ( [0] => 14 [1] => 16 [2] => 19 [3] => 24 [4] => 25 [5] => 26 [6] => 29 [7] => 31 [8] => 33 [9] => 34 [10] => 35 [11] => 36 [12] => 37 [13] => 40 [14] => 45 [15] => 49 [16] => 51 ) [ajax] => Array ( [0] => 91 [1] => 110 [2] => 113 [3] => 172 ) ) 

then it is throwing me output as the result of the key having max values. in this case it will return me all the values of java key.

but my expected output is 0. please help.

  • 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-17T04:03:12+00:00Added an answer on June 17, 2026 at 4:03 am

    I copyed you example and for me it works:

    <?php
    
    $array = array(
        'php' => array(
            36,
            51,
            116,
            171,
            215,
            219,
            229,
            247,
            316,
        ),
        'java' => array(
            14,
            16,
            19,
            24,
            25,
            26,
            29,
            31,
            33,
            34,
            35,
            36,
            37,
            40,
            45,
            49,
            51,
        ),
        'ajax' => array(
            91,
            110,
            113,
            172,
        ),
    );
    
    $intersected_array = call_user_func_array('array_intersect',$array);
    
    print_r($intersected_array);
    
    // RESULT: "Array ( ) "
    

    Please copy exactly this code and tell me your output.

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

Sidebar

Related Questions

I have a php multidimensional array which looks like this: $fields = array( array('input',
I have a PHP multidimensional array which will store information depending on parameters input.
I have a multidimensional array which I am looping through using a foreach loop.
I have a function which sorts data in a multidimensional array, as shown below:
All, I have the following array and function, which will create a multidimensional array
hi i have multidimensional array in php i want to remove an index from
I have a multidimensional array, here: $noticeDate = json_encode( $noticesDates ); and I want
I have a multidimensional array of arrays (source below), where my keys and values
I have a multidimensional array, which consists of 426 smaller arrays, which also comprise
I have a string which represents a multidimensional array in the format: [[A, a],

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.