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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:32:16+00:00 2026-06-16T00:32:16+00:00

I am terrible with manipulating arrays…given this structure I want to remove the top

  • 0

I am terrible with manipulating arrays…given this structure I want to remove the top level array and merge all subsets into one flat array:

Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [0] => hey.com
                )

            [1] => Array
                (
                    [0] => you.com
                )
        )
    [1] => Array
        (
            [0] => Array
                (
                    [0] => this.com
                )

            [1] => Array
                (
                    [0] => rocks.com
                )
        )
)

to desired structure:

Array
    (
        [0] => hey.com
        [1] => you.com
        [2] => this.com
        [3] => rocks.com
    )

Speed is essential – we will be dealing with hundreds of thousands of results

  • 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-16T00:32:16+00:00Added an answer on June 16, 2026 at 12:32 am

    You can use RecursiveArrayIterator

    $it = new RecursiveIteratorIterator(new RecursiveArrayIterator($data));
    $list = iterator_to_array($it,false);
    var_dump($list);
    

    Output

    array (size=4)
      0 => string 'hey.com' (length=7)
      1 => string 'you.com' (length=7)
      2 => string 'this.com' (length=8)
      3 => string 'rocks.com' (length=9)
    

    See Simple Demo

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

Sidebar

Related Questions

Excuse the terrible question title. I have this PHP string and want to check
I am having a terrible time figuring this one out. I have a form.
I'm using this terrible API for a client. It packages HTML/JS to an iPad
I'm having terrible trouble trying to get a navigation controller up-and-running. Basically, I want
I know this is a terrible way of doing things, but it's for an
Somebody wrote this (very terrible) function to translate a numeric value from 0-999 to
I have this terrible problem with IE 7/8/9. I wrote an app using Dojo
Apologies for the terrible title, not really sure how to explain this without a
This may be a terrible idea (feel free to tell me if it is),
As terrible and disgusting as this sounds, I would like to be able to

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.