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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:19:15+00:00 2026-06-14T01:19:15+00:00

After several attempts I couldn’t figure out a efficient way to do this. I

  • 0

After several attempts I couldn’t figure out a efficient way to do this. I currently have a function running preg_match_all and returning three arrays like this;

array(3) {
    ["name"] => 
        array(3) { 
             0 => "Google Chrome 22.0.1229.94",
             1 => "LastPass for Chrome 2.0.7",
             2 => "Chromatic 0.2.3"
        }

    ["link"] => 
        array(3) {
            0 => "/app/mac/32956/google-chrome",
            1 => "/app/mac/42578/lastpass-for-chrome",
            2 => "/app/mac/32856/chromatic"
        }

    ["description"] =>
        array(3) {
            0 => " - Modern and fast Web browser."
            1 => " - Online password manager and form filler for Chrome."
            2 => " - Easily install and updated Chromium."
    }
}

I need to able to combine the three arrays like this;

array(3) {
    array(3) {
        ["name"]        = "Google Chrome 22.0.1229.94",
        ["link"]        = "/app/mac/32956/google-chrome",
        ["description"] = " - Modern and fast Web browser."
    }

    array(3) {
        ["name"]        = "LastPass for Chrome 2.0.7",
        ["link"]        = "/app/mac/42578/lastpass-for-chrome",
        ["description"] = " - Online password manager and form filler for Chrome."
    }

    array(3) {
        ["name"]        = "Chromatic 0.2.3",
        ["link"]        = "/app/mac/32856/chromatic",
        ["description"] = " - Easily install and updated Chromium."
    }
} 

I’ve been trying to count( $values ) and doing a for loop to make new array.

  • 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-14T01:19:16+00:00Added an answer on June 14, 2026 at 1:19 am

    This is my take, for your particular case, given your origin array is $results :

    for ($i=0; $i<3;$i++) {
       $combined[$i]['name'] = $results['name'][$i];
       $combined[$i]['link'] = $results['link'][$i];
       $combined[$i]['description'] = $results['description'][$i];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

after several attempts, I can not solve this problem. I have the following mysql
After several unsuccessful attempts to use JXTA api, i have decided to roll out
After several failed attempts using ExtJS I have now decided to use javascript.The requirement
so i have made several attempts at this, but decided i needed some advice
I've been trying to figure this out for almost the whole day, and after
After reading several articles of a hierarchical data tables, I've made my way into
I had a class that only worked in Delphi 7 and after several attempts
after several attempts and some searching I finally decided to try it here. Short
I'm trying to implement the Sieve of Eratosthene in C++. However after several attempts
Great page this one, coming from the perl world and after several years of

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.