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 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 want to traverse this array and display, 'comment' as bullet points. Array (
Generally we traverse the array by row or column but here I want to
want to know why String behaves like value type while using ==. String s1
I have the following tree: 1-[HAS]->2-[HASSUBPAGE]->3-[HASSUBPAGE]->4 Now I want to traverse this tree starting
I want to display phrases from a pre-defined array (array.xml) in a TextView and
I have a 2d matrix, i want to traverse all elements in this matrix
I am passing an Integer array to a function. Next I want to traverse
I'm having the following issue - I want to traverse all the xml files
i am currently implementing a binary tree in c++ and i want to traverse
I want to override the selection behavior of ListBox Items. We can traverse through

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.