Hi All,
I have a question about arrays and LDAP. I recently found a wonderful class called adLDAP, and I have configured it to connect to our AD server and i'm pulling lots of good information.
The problem I'm having now is trying to pull that information from the array it outputs and use the information as variables. Lets say I want to pull the email for the user and set it as a variable. I know this is a relatively easy array function but I'm just unsure how to do it.
Here is the Array that is being produced:
Array ( [count] => 1 [0] => Array ( [memberof] => Array ( [count] => 5 [0] => CN=NHC Users,CN=Users,DC=newportharbor,DC=com [1] => CN=Newport Harbor Corporation,CN=Users,DC=newportharbor,DC=com [2] => CN=Entire Company,CN=Users,DC=newportharbor,DC=com [3] => CN=Marketing,CN=Users,DC=newportharbor,DC=com [4] => CN=Domain Users,CN=Users,DC=newportharbor,DC=com ) [0] => memberof [displayname] => Array ( [count] => 1 [0] => NHC - Marketing Intern ) [1] => displayname [mail] => Array ( [count] => 1 [0] => mktint@newportharbor.com ) [2] => mail [primarygroupid] => Array ( [count] => 1 [0] => 513 ) [3] => primarygroupid [samaccountname] => Array ( [count] => 1 [0] => market ) [4] => samaccountname [count] => 5 [dn] => CN=NHC - Marketing Intern,OU=Marketing,OU=NHC,DC=newportharbor,DC=com ) )
I'm using the print_r to produce this result. Thanks for all your help!!!