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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:32:00+00:00 2026-05-22T14:32:00+00:00

I have a multidimensional array which I need to be sorted with uniqueness as

  • 0

I have a multidimensional array which I need to be sorted with uniqueness as I have duplicated records, so I need array_unique to go through the array and remove duplicates by the value, e.g.

Array
(
    [0] => Array
        (
            [id] => 324
            [time_start] => 1301612580
            [level] => 0.002
            [input_level] => 0.002
        )

    [1] => Array
        (
            [id] => 325
            [time_start] => 1301612580
            [level] => 0.002
            [input_level] => 0.002
        )

    [2] => Array
        (
            [id] => 326
            [time_start] => 1301612580
            [level] => 0.002
            [input_level] => 0.002
        )
)

There are duplicated time_start, which they are all the same, also level and input_level but they are not to be affected, only if there are matching time_start it should remove it and process the whole array (the array is bigger than you think, but I just posted a small example of the array). Should remove dupes and return like this:

Array
(
    [0] => Array
        (
            [id] => 324
            [time_start] => 1301612580
            [level] => 0.002
            [input_level] => 0.002
        )
)

Questions I’ve found that didn’t work:

  • reformat multidimensional array based on value
  • Delete element from multidimensional-array based on value
  • 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-22T14:32:01+00:00Added an answer on May 22, 2026 at 2:32 pm
    $input = array( /* your data */ );
    $temp  = array();
    $keys  = array();
    
    foreach ( $input as $key => $data ) {
        unset($data['id']);
        if ( !in_array($data, $temp) ) {
            $temp[]     = $data;
            $keys[$key] = true;
        }
    }
    
    $output = array_intersect_key($input, $keys);
    

    or

    $input = array( /* your data */ );
    $temp  = $input;
    
    foreach ( $temp as &$data ) {
        unset($data['id']);
    }
    
    $output = array_intersect_key($input, array_unique($temp));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how do I make a pointer to a multidimensional array, which have a unknown
I have a multidimensional array. I need to search it for a specific range
I have a string which represents a multidimensional array in the format: [[A, a],
I have a multidimensional array in which the first level keys needs to be
I have a multidimensional array which is the result of a JOIN statement. And
I have a multidimensional array $BlockData[] which has 13 dimensions in it and 'n'
I have a multidimensional histogram H=histogramdd((x,y,z),bins=(nbins,nbins,nbins),range=((0,1),(0,1),(0,1))) I need to print in an array the
I have a multidimensional array which is created by a MySQL query which collects
I have a PHP multidimensional array which will store information depending on parameters input.
I have a multidimensional array called $songs , which outputs the following: 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.