SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Print multi-dimensional arrays

    I have array like this.
    I printed it out with print_r($array);

    Code PHP:
    array ( [dataroot] => array ( [Table1] => array ( [0] => array
                            (
                                [ID] => Array
                                    (
                                        [value] => 1310
                                    )
     
                                [_x0030_9] => Array
                                    (
                                        [value] => *
                                    )
     
                                [value] => 
                            )

    I want to echo only ID data.
    Any idea?
    Thanks.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    foreach ($array['dataroot']['Table1'] as $sub_array) {
        echo 
    $sub_array['ID']['value'];


  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2006
    Posts
    88
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was already going mad.

    Many thanks mate.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •