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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:56:39+00:00 2026-05-26T00:56:39+00:00

I have this array and I can’t figure out how to dissect it and

  • 0

I have this array and I can’t figure out how to dissect it and get it to built onto itself.

I have compiled my array to what I think might be the easiest to keep track of:

Array
(
    [domain.com] => Array
        (
            [dev] => Array
                (
                    [path] => /var/www/config/
                    [ini] => Array
                        (
                            [0] => db
                            [1] => common
                        )

                )

            [theme] => Array
                (
                    [path] => /var/ww/themes/
                    [ini] => theme
                )

        )

)

My whole thing is that I want to make a helper class to parse ini files. So I have through a couple of methods been able to build my array like above.

My end goal is have something like this parse_ini_file($ini[$domain][$nick][path] . $ini[$domain][$nick][ini] . ".ini", true)

where $nick is either 'dev' or 'theme' its just a way for me to distinguish paths and ini that belong together.

I have tried to do a foreach loop through each key value pair but I’m stuck on the fact that one of my values holds an array.

foreach (self::$ini[$domain] as $k => $v) {
    //if (self::$ini[$domina][$nick]['path'][$k] === self::$ini[$domain][$nick]['ini'][$k])
        foreach (self::$ini[$domain][$k] as $i => $l) {

            foreach ($l as $m => $n)
                //if (!is_array($i)) {

                   // (strlen($i) - 1 === '/' ? $i : $i . '/');
                    echo $n;
                    //self::$built = parse_ini_file($i . $j, true);
                //}
            }
}

It may seem like a mess, but i didn’t bother with making meaningful variable names until I am able to make a solid code block. But In my attempt I have done a foreach loop through the $domain array to extract each $nick from there I thought doing another foreach to then break it down to get the path and ini key => values to then built the parse ini file function. But like I said, one of my ini key’s holds an array so I’m not sure how to loop through that while still being able to parse an ini file and not overwriting the holder variable $built

Any help would really be appreciated!

  • 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-26T00:56:39+00:00Added an answer on May 26, 2026 at 12:56 am

    You must first go and read about recursion. Just type the word into Google or even Wikipedia, you’ll get the idea. Or just look for array_merge and array_merge_recursive at http://php.net, that’s what you need. But first read about recursion anyway, you should know such basic things if you are going to write code further.

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

Sidebar

Related Questions

how i can duplicate one element from array: for example, i have this array:
If you have a string of 1,2,3,1,5,7 you can put this in an array
I have an array which contains around 50-200 hyperlinks. How can I pass this
can anyone help me on this.Lets say I have this array of string e.g.
I have this array of names (listedName) that I want to filter out and
hey, I have this array (the actual array can be several level deeps and
I have this array: unsigned char* data = CGBitmapContextGetData(cgctx); then I tried to get
I have this function in jquery which has the result array and how can
I have this array that I am displaying with a table how can i
I have this array: $numbers = array(1, 2, 3); I can grab a random

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.