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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:19:19+00:00 2026-05-13T08:19:19+00:00

Hey all, basically, i have an array: array(‘a’, ‘b’, ‘c’); Now i run it

  • 0

Hey all, basically, i have an array:

array('a', 'b', 'c');

Now i run it through an array permutation function and the result is:

Array
(
    [0] => Array
        (
            [0] => C
        )

    [1] => Array
        (
            [0] => B
        )

    [2] => Array
        (
            [0] => B
            [1] => C
        )

    [3] => Array
        (
            [0] => C
            [1] => B
        )

    [4] => Array
        (
            [0] => A
        )

    [5] => Array
        (
            [0] => A
            [1] => C
        )

    [6] => Array
        (
            [0] => C
            [1] => A
        )

    [7] => Array
        (
            [0] => A
            [1] => B
        )

    [8] => Array
        (
            [0] => B
            [1] => A
        )

    [9] => Array
        (
            [0] => A
            [1] => B
            [2] => C
        )

    [10] => Array
        (
            [0] => A
            [1] => C
            [2] => B
        )

    [11] => Array
        (
            [0] => B
            [1] => A
            [2] => C
        )

    [12] => Array
        (
            [0] => B
            [1] => C
            [2] => A
        )

    [13] => Array
        (
            [0] => C
            [1] => A
            [2] => B
        )

    [14] => Array
        (
            [0] => C
            [1] => B
            [2] => A
        )

)

Now my question is, how can i clean that array up so that:

array ( C, B )
is the same as
array ( B, C )

and it removes the second array

How would i do that?

EDIT… after some research based on your answers, this is what I came up with:

array_walk($array, 'sort');
$array = array_unique($array);

sort($array); // not necessary
  • 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-13T08:19:19+00:00Added an answer on May 13, 2026 at 8:19 am

    Just sort the constituent arrays:

    foreach ($arrays AS &$arr)
    {
       sort($arr);
    }
    

    So {“C”, “B”} becomes => {“B”, “C”}
    and {“B”, “C”} becomes => {“B”, “C”}

    which are identical.

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

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'm using the naming you used in the table in… May 17, 2026 at 3:16 am
  • Editorial Team
    Editorial Team added an answer I'm hesitant to suggest this, because this is "asking for… May 17, 2026 at 3:16 am
  • Editorial Team
    Editorial Team added an answer The simplest way to get a video webchat application is… May 17, 2026 at 3:16 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Hey all, basically i have an empty AS3 fla file with just the following
Hey all. Basically I have a page full of text input fields with default
Hey all. I have a question on how to implement the following with Django.
hey all.i'm newbie at this problem.i have this data in table result: item range_code
Hey, so basically I have this issue, where I'm trying to put an equation
Hey all, I've noticed that if I have a style setup for a treeview,
Hey all. Quick question on Fluent syntax. I had thought I had this down,
Hey all, having an issue getting asp buttons to interact with JQuery. I'm basically
hey all my question about how the developers makes their interface the buttons, slider,
Hey all, looking to see if theres a way to easily include external html

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.