note 14844 added to function.ldap-get-entries.php
| From: | c dot green at its dot uq dot edu dot au | Date: | Fri, 17 Aug 2001 08:25:06 +0000 |
| Subject: | note 14844 added to function.ldap-get-entries.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16833@lists.php.net to get a copy of this message | ||
In response to the first message ldap_get_entries, I think there is some confusion with the dynamic
typing of php.
If the result is a string doing $foo[0] will return the first character of the string.
In the case of an array $foo[0] will return the entire first element.
Its not to do with the 'dn' in particular, rather the fact that the dn is a scalar value
(ie a string) rather than an array, and the indexing works differently in either case.
For debugging purposes I would recommend using something like :
$value = is_array($foo) ? $foo[0] : $foo;
or
$value = is_array($foo) ? implode($foo, $delimiter) : $foo;
http://www.php.net/manual/en/function.ldap-get-entries.php