It has been mentioned in the comments below, but the <?php ldap_get_entries($connection,$result) ?> always makes all attributes into lower-case. I found out the hard way that if I'm running an ldap query against the corporate AD and then want to display some results, nothing is actually displayed unless the attribute names area in lower-case.
Example:
<?php
include('ad_con.php');
$attributes_ad = array("displayName","description","cn","givenName","sn","mail","co","mobile","company","displayName");
$base ="";
$result = ldap_search($conn, $base, "mail=$email*", $attributes_ad) or die ("Error in search
query");
$info = ldap_get_entries($conn, $result);
for ($i=0; $i<$info["count"]; $i++)
{
echo $info[$i]["displayname"][0]
}
?>