How to output Multi-Dimensional array value
<p>I am trying to display a multi-dimensional array in javascript. Could someone help me about my code? Thanks.</p>

<pre><code>for (var i=0;i&lt;array.length;i++){

    for (var a=0;a&lt;array[i].length;a++){

       //document.write(array[0][0])    //this will have output
       document.write(array[i][a])      //this won't.

    }

}
</code></pre>

<p>updated:</p>

<p>my array</p>

<p>The array was created from php then use json_encode to parse to JS.</p>

<pre><code>   Array
(
    [0] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; In UK, HTC Defeats Apple's "Obvious" Slide Unlock Patent
        )

    [1] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; timothy
        )

    [2] =&gt; SimpleXMLElement Object
        (
        )

    [3] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T14:10:00+00:00
        )

    [4] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; WikiLeaks Begins Release of 2.5m Syrian Emails
        )

    [5] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; timothy
        )

    [6] =&gt; SimpleXMLElement Object
        (
        )

    [7] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T13:29:00+00:00
        )

    [8] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; A Critical Examination of Bill Gates' Philanthropic Record
        )

    [9] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [10] =&gt; SimpleXMLElement Object
        (
        )

    [11] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T12:07:00+00:00
        )

    [12] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Ask Slashdot: How Does Your Company Evaluate Your Performance?
        )

    [13] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [14] =&gt; SimpleXMLElement Object
        (
        )

    [15] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T08:52:00+00:00
        )

    [16] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; UAV Cameras an Eye In the Sky For Adventurous Filmmakers
        )

    [17] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [18] =&gt; SimpleXMLElement Object
        (
        )

    [19] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T05:55:00+00:00
        )

    [20] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Copyrights To Reach Deep Space
        )

    [21] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [22] =&gt; SimpleXMLElement Object
        (
        )

    [23] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T02:46:00+00:00
        )

    [24] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; FDA Approves HIV Home-Use Test Kit
        )

    [25] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [26] =&gt; SimpleXMLElement Object
        (
        )

    [27] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-05T00:13:00+00:00
        )

    [28] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Texas Scientists Regret Loss of Higgs Boson Quest
        )

    [29] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; samzenpus
        )

    [30] =&gt; SimpleXMLElement Object
        (
        )

    [31] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-04T23:25:00+00:00
        )

    [32] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Icelandic MP Claims US Vendetta Against WikiLeaks
        )

    [33] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Soulskill
        )

    [34] =&gt; SimpleXMLElement Object
        (
        )

    [35] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-04T22:38:00+00:00
        )

    [36] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Microsoft's 'Cannibalistic Culture'
        )

    [37] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Soulskill
        )

    [38] =&gt; SimpleXMLElement Object
        (
        )

    [39] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-04T21:50:00+00:00
        )

    [40] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Android 4.1 Jelly Bean Review
        )

    [41] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Soulskill
        )

    [42] =&gt; SimpleXMLElement Object
        (
        )

    [43] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-04T21:04:00+00:00
        )

    [44] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; John the Ripper Cracks Slow Hashes On GPU
        )

    [45] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; Soulskill
        )

    [46] =&gt; SimpleXMLElement Object
        (
        )

    [47] =&gt; SimpleXMLElement Object
        (
            [0] =&gt; 2012-07-04T20:38:00+00:00
        )

)
</code></pre>
