0
<ol class="dd-list" id="start">
        <li class="dd-item dd3-item">
            <div class="dd-handle dd3-handle"></div>
            <div class="dd3-content">Home</div>
            <div class="url" style="display:none;">homeurl</div>
        </li>
        <li class="dd-item dd3-item">
            <div class="dd-handle dd3-handle"></div>
            <div class="dd3-content">About Us</div>
            <div class="url" style="display:none;">abouturl</div>
        </li>
        <li class="dd-item dd3-item">
            <div class="dd-handle dd3-handle"></div>
            <div class="dd3-content">Gallery</div>
            <div class="url" style="display:none;">galleryurl</div>
            <ol class="dd-list">
                <li class="dd-item dd3-item">
                    <div class="dd-handle dd3-handle"></div>
                    <div class="dd3-content">Contact</div>
                    <div class="url" style="display:none;">contacturl</div>
                </li>
            </ol>
        </li>
    </ol>

Hi I want to loop through this ordered list and save the values in a multi-dimensional array.

I tried to do this in PHP but it was too difficult. Thanks.

2
Contributors
8
Replies
38
Views
3 Years
Discussion Span
Last Post by iamthwee
0

Thanks prit but that didn't really help. Any ideas, or is it better to do this in PHP server side.

0

I would like it to look like:

{
    "content": [
        {
            "content": [
                {
                    "css": "dd-handle dd3-handle"
                }, 
                {
                    "content": {
                        "text": "Home"
                    }, 
                    "css": "dd3-content"
                }, 
                {
                    "attrs": {
                        "style": "display:none;"
                    }, 
                    "content": {
                        "text": "homeurl"
                    }, 
                    "css": "url"
                }
            ], 
            "css": "dd-item dd3-item", 
            "type": "li"
        }, 
        {
            "content": [
                {
                    "css": "dd-handle dd3-handle"
                }, 
                {
                    "content": {
                        "text": "About Us"
                    }, 
                    "css": "dd3-content"
                }, 
                {
                    "attrs": {
                        "style": "display:none;"
                    }, 
                    "content": {
                        "text": "abouturl"
                    }, 
                    "css": "url"
                }
            ], 
            "css": "dd-item dd3-item", 
            "type": "li"
        }, 
        {
            "content": [
                {
                    "css": "dd-handle dd3-handle"
                }, 
                {
                    "content": {
                        "text": "Gallery"
                    }, 
                    "css": "dd3-content"
                }, 
                {
                    "attrs": {
                        "style": "display:none;"
                    }, 
                    "content": {
                        "text": "galleryurl"
                    }, 
                    "css": "url"
                }, 
                {
                    "content": {
                        "content": [
                            {
                                "css": "dd-handle dd3-handle"
                            }, 
                            {
                                "content": {
                                    "text": "Contact"
                                }, 
                                "css": "dd3-content"
                            }, 
                            {
                                "attrs": {
                                    "style": "display:none;"
                                }, 
                                "content": {
                                    "text": "contacturl"
                                }, 
                                "css": "url"
                            }
                        ], 
                        "css": "dd-item dd3-item", 
                        "type": "li"
                    }, 
                    "css": "dd-list", 
                    "type": "ol"
                }
            ], 
            "css": "dd-item dd3-item", 
            "type": "li"
        }
    ], 
    "css": "dd-list", 
    "id": "start", 
    "type": "ol"
}
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.