Results 1 to 3 of 3

Thread: [RESOLVED] Count Multidimensional Arary Items

Threaded View

  1. #1

    Thread Starter
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Resolved [RESOLVED] Count Multidimensional Arary Items

    I've created an array with the below format.

    $UserDetails[0][0]
    $UserDetails[1][0]
    $UserDetails[2][0]

    $UserDetails[0][1]
    $UserDetails[1][1]
    $UserDetails[2][1]


    I need to loop through the array but count($UserDetails) returns 3 which seems incorrect as there are only 2 "items" in the array that contains 3 values each. How can I get the number of "items" (in this case 2)?


    EDIT: If it makes a difference I'm declaring $UserDetails as a gloabl array.
    PHP Code:
    $GLOBALS['UserDetails'] = $UserDetails//make available in another function

    //Then to call it in another function
    global $UserDetails
    Last edited by lintz; Feb 27th, 2006 at 08:02 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width