The search() function only performs the search. You will need to use the fetch() function to retrieve the data.
For information on LDAP search filters, look at the ldap_search man page, or visit RFC 1558.
Example:
$ldap = new LDAP();
$ldap->search("(objectclass=*)");
...
$attrs[$ldap->getDN()] = $ldap->fetch();
...