note 37391 added to function.ldap-get-entries

From: Date: Thu, 13 Nov 2003 12:59:58 +0000
Subject: note 37391 added to function.ldap-get-entries
Groups: php.notes 
Request: Send a blank email to php-notes+get-60332@lists.php.net to get a copy of this message
I have found that ldap_get_entries() function doesn't handle binary data correctly. I had to write my own using ldap_get_values_len(). // will use ldap_get_values_len() instead and build the array // note: it's similar with the array returned by // ldap_get_entries() except it has no "count" elements $i=0; $entry = ldap_first_entry($this->conn, $this->srchRslt); do { $attributes = ldap_get_attributes($this->conn, $entry); for($j=0; $j<$attributes['count']; $j++) { $values = ldap_get_values_len($this->conn, $entry,$attributes[$j]); $this->rawData[$i][$attributes[$j]] = $values; } $i++; } while ($entry = ldap_next_entry($this->conn, $entry)); //we're done return ($this->rawData); ---- Manual Page -- http://www.php.net/manual/en/function.ldap-get-entries.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37391 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37391&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37391&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60332) next »