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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:05:20+00:00 2026-05-25T16:05:20+00:00

I want to traverse this array and display, in bulleted divs. I know this

  • 0

I want to traverse this array and display, in bulleted divs. I know this look a lot suspicious, like do it yourself. But I cant get past the nested foreach problem, especially, when it comes to deph of the threads. I got an answer in a previous question Traverse Array and Display In Bullet Points, but i’m not sure how to change the markup in the solution that was given…. or if its possible. Below is the array, and i have a link to the pastebin of the markup i would like, but would be awesome if the markup can be changed easily in the future, ie markup views separated from logic.

Array
(
    [1] => Array
        (
            [id] => 1
            [comment_title] => comment title
            [comment] => a
            [comment_date] => comment date
            [parent_id] => 0
            [children] => Array
                (
                    [3] => Array
                        (
                            [id] => 3
                            [comment_title] => comment title
                            [comment] => this is another comment
                            [comment_date] => comment date
                            [parent_id] => 1
                            [depth] => 0
                            [child_count] => 0
                            [children] => 
                        )

                    [4] => Array
                        (
                            [id] => 4
                            [comment_title] => comment title
                            [comment] => this is a third comment
                            [comment_date] => comment date
                            [parent_id] => 1
                            [depth] => 0
                            [child_count] => 0
                            [children] => 
                        )

                )

            [depth] => 1
            [child_count] => 2
        )

    [2] => Array
        (
            [id] => 2
            [comment_title] => comment title
            [comment] => this is yet another comment
            [comment_date] => comment date
            [parent_id] => 0
            [children] => Array
                (
                    [5] => Array
                        (
                            [id] => 5
                            [comment_title] => comment title
                            [comment] => another comment
                            [comment_date] => comment date
                            [parent_id] => 2
                            [children] => Array
                                (
                                    [7] => Array
                                        (
                                            [id] => 7
                                            [comment_title] => comment title
                                            [comment] => Hey im a comment!
                                            [comment_date] => 1/1/1970
                                            [parent_id] => 5
                                            [children] => Array
                                                (
                                                    [8] => Array
                                                        (
                                                            [id] => 8
                                                            [comment_title] => comment title
                                                            [comment] => I disagree
                                                            [comment_date] => 1/1/1970
                                                            [parent_id] => 7
                                                            [children] => Array
                                                                (
                                                                    [9] => Array
                                                                        (
                                                                            [id] => 8
                                                                            [comment_title] => comment title
                                                                            [comment] => My comment is...
                                                                            [comment_date] => 1/1/1970
                                                                            [parent_id] => 8
                                                                            [children] => Array
                                                                                (
                                                                                    [10] => Array
                                                                                        (
                                                                                            [id] => 8
                                                                                            [comment_title] => comment title
                                                                                          [comment] => Hey im a comment!
                                                                                   [comment_date] => 1/1/1970
                                                                                            [parent_id] => 9
                                                                                            [depth] => 0
                                                                                            [child_count] => 0
                                                                                            [children] => 
                                                                                        )

                                                                                )

                                                                            [depth] => 1
                                                                            [child_count] => 1
                                                                        )

                                                                )

                                                            [depth] => 2
                                                            [child_count] => 1
                                                        )

                                                )

                                            [depth] => 3
                                            [child_count] => 1
                                        )

                                )

                            [depth] => 4
                            [child_count] => 1
                        )

                    [6] => Array
                        (
                            [id] => 6
                            [comment_title] => comment title
                            [comment] => This is the last comment
                            [comment_date] => 1/1/1970
                            [parent_id] => 2
                            [depth] => 0
                            [child_count] => 0
                            [children] => 
                        )

                )

            [depth] => 5
            [child_count] => 2
        )

)

Here is the markup i want to use. http://pastebin.com/MBppxiC7

  • 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-25T16:05:21+00:00Added an answer on May 25, 2026 at 4:05 pm

    In the code that I provided you before, just try adding pieces of code and you will get how it works. Once you begin understanding the code I made, you will be able to extend it and add your extra features.

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

Sidebar

Related Questions

I am passing an Integer array to a function. Next I want to traverse
Want to know what the stackoverflow community feels about the various free and non-free
I want to assign the decimal variable "trans" to the double variable "this.Opacity". decimal
I want to create a client side mail creator web page. I know the
I want to reference a COM DLL in a .NET project, but I also
I want to log onto Stack Overflow using OpenID, but I thought I'd set
I have a two dimensional polygon mesh made of connected triangles represented like this:
I want to transform the 'values' array created by xml_parse_into_struct() into a bunch of
I want to build a hierarchy from a one-dimensional array and can (almost) do
I have an array of input controls garnered like so: var hiddenInputs = $(input[id^='Unanswered'])

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.