Link to home
Start Free TrialLog in
Avatar of ats2012
ats2012

asked on

Issues displaying Multidimensional Array using php and ADldap plugin

I am pulling member data out of a Active directory group using

$groupinfo = $adldap->group()->info('group', array('member'));

Open in new window


I would like to display the count but am having issues echoing the data. Below is what the array looks like. How would the echo code look like. Been working on this and can' figure it out.

Array
(
    [0] => 1
    [1] => Array
        (
            [member] => Array
                (
                   [count] => 23
                    [0] => Data
                    [1] => Data
                    [2] => Data
                    [3] => Data
                    [4] => Data
                    [5] => Data
                    [6] => Data
                    [7] => Data
                    [8] => Data
                    [9] => Data
                    [10] => Data
                    [11] => Data
                    [12] => Data
                    [13] => Data
                    [14] => Data
                    [15] => Data
                    [16] => Data
                    [17] => Data
                    [18] => Data
                    [19] => Data
                    [20] => Data
                    [21] =>Data
                    [22] => Data
                )

            [0] => member
            [count] => 1
            [dn] => Data
        )

)

Open in new window

Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

echo $groupinfo[1]["member"]["count"];
Avatar of ats2012
ats2012

ASKER

I tried that combination and this is the error I receive

 SCREAM: Error suppression ignored for
( ! ) Notice: Undefined offset: 1 in E:\wamp\www\ats\citrix_xenapp.php on line 36
Call Stack
#	Time	Memory	Function	Location
1	0.0004	146088	{main}(  )	..\citrix_xenapp.php:0

Open in new window

:
ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ats2012

ASKER

The Array is being printing using print_r so this is correct but it still spits out that error. I don't get it.
Avatar of ats2012

ASKER

This is only looking at one group.
Avatar of ats2012

ASKER

Interesting if I use:

echo $groupinfo[0]["member"]["count"];

This is the output:

23Array
Avatar of ats2012

ASKER

I got this working now. Its a 0 instead of 1. Not sure why.