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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:38:46+00:00 2026-06-09T14:38:46+00:00

I have a 2d array $list[‘1′][] =’23’; $list[‘1′][] =’24’; $list[‘1′][] =’25’; $list[‘1′][] =’26’; And

  • 0

I have a 2d array

$list['1'][] ='23';
$list['1'][] ='24';
$list['1'][] ='25';
$list['1'][] ='26';

And a 1d array

$items={"23","24","36"};

following is right syntax for 1d array.

$items=array("23","24","36");

I want to check whether the $List[‘1’] values are inside the $items are not, if the items are not then store them into a new array

I tried

$different['1'][] = array_diff($items,$list['1']);

but if there are no difference it creates an array with key but empty value

$different[‘1]

['1'] => Array
    (
        [0] => 
    )
  • 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-09T14:38:47+00:00Added an answer on June 9, 2026 at 2:38 pm
    if($diff = array_diff($items,$list['1])){
         $different['1'][] = $diff;
    }
    

    This should do the trick

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

Sidebar

Related Questions

I have an array list called str, i want to see the elements inside
I have an array containing a list of files. I want to sort it
I have a collection (or list or array list) in which I want to
I want to have an array list in vba, hence I have a variant
I have any array $num_list = array(42=>'0',44=>'0',46=>'0',48=>'0',50=>'0',52=>'0',54=>'0',56=>'0',58=>'0',60=>'0'); and I want to change specific values
I have an array list: private ArrayList<PerfStatBean> statFilterResults; I want to iterate through it
I have an array List<double[]> values = new ArrayList<double[]>(); values.add(new double[] { 12.3, 12.5,
I have an array list containing few elements. What i want to do is
I have an array list called str, i want to see how many elements
I have an Array List that I want to output like my example below.

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.