<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.

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

Show a sample of what you want.

Uno momento por favor...

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"
}

That's almost the entire HTML... why don't you send that instead? What is the goal on the PHP side?

I've decided to do this with PHP