title: undefined index warning in PHP for LDAP attribute / associative array?
body: <p>I am having trouble retrieving some data out of an LDAP attribute in PHP.</p>
  
  <p>I connect to LDAP, perform my query, and store the results in a var like so: </p>
  
  <p><code>$info = ldap_get_entries($connect, $sr);</code></p>
  
  <p>Now, I can store most of the LDAP attributes I need in sessions vars, like so: </p>
  
  <pre><code>        $_SESSION['accountFirstName'] = $info[0]['givenname'][0];
          $_SESSION['accountLastName'] = $info[0]['sn'][0];
          $_SESSION['accountEmail'] = $info[0]['mail'][0];
  </code></pre>
  
  <p>These work fine.. No problems. However, there is another var I need to store. I believe It is an associative array. For some reason, no matter what I do, I am getting an <code>NOTICE: Undefined index</code> warning for that specific attribute. I have tried storing it like the above demonstration, but to be honest I'm not entirely sure what the [0] indices on either ends of the attribute name mean.. I'm not familiar with LDAP and frankly the setup is very confusing. </p>
  
  <p>So I guess my questions are: </p>
  
  <ul>
  <li><p>how do you access associative arrays that are returned from an LDAP
  query?  </p></li>
  <li><p>what does 'undefined index' mean? Does it mean that that
  attribute does not exist, or it does not exist at the index provided?</p></li>
  <li><p>How can I test my LDAP query to see if the variable even exists? </p></li>
  <li><p>There is a possibility that the account performing the query does not
  have adequate LDAP access privileges (the project is for a university
  and there is a lot of red tape). Is there any way for me to verify
  that through code?</p></li>
  </ul>
  
  <p>Thank you! And my apologies for the vagueness of the information provided, I can't be too open-mouthed right now.</p>