The code listed below (posted by jeff) to print all attributes with their values is wrong. It keeps trying to index the $entry variable, which is a resource identifier, not an array. All the required information is in the return value of ldap_get_attributes, $attrs.
So:
$entry = ldap_next_entry($conn,$first_entry);
$attrs = ldap_get_attributes($conn,$entry);
for ($i=0; $i < $attrs["count"]; $i++) {
$attr_name = $attrs[$i];
for ($j=0; $j < $attrs[$attr_name]["count"]; $j++) {
echo "$attr_name: ".$attrs["$attr_name"][$j]."\n";
}
}