note 64104 added to function.ldap-add
| From: | cyberkate24 at voila dot fr | Date: | Fri, 07 Apr 2006 13:24:12 +0000 |
| Subject: | note 64104 added to function.ldap-add | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-107514@lists.php.net to get a copy of this message | ||
LDAP doesn't like empty fields, and here is a code I've added in a code posted here, but
which doesn't manage the case of an array in an array. I hope that will help you :
$new_entry = array();
foreach ($entry as $key => $value)
{
if ($value != "")
{
if (is_array($value))
{
foreach ($value as $mv_key => $mv_cur_val)
{
if ($mv_cur_val != '')
{
$new_entry[$key][$mv_key] = $mv_cur_val;
}
}
}
else
{
$new_entry[$key] = $value;
}
}
}
----
Server IP: 217.174.203.10
Probable Submitter: 62.210.101.107
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.ldap-add.php
Edit -- http://master.php.net/note/edit/64104
Del: integrated -- http://master.php.net/note/delete/64104/integrated
Del: useless -- http://master.php.net/note/delete/64104/useless
Del: bad code -- http://master.php.net/note/delete/64104/bad+code
Del: spam -- http://master.php.net/note/delete/64104/spam
Del: non-english -- http://master.php.net/note/delete/64104/non-english
Del: in docs -- http://master.php.net/note/delete/64104/in+docs
Del: other reasons-- http://master.php.net/note/delete/64104
Reject -- http://master.php.net/note/reject/64104
Search -- http://master.php.net/manage/user-notes.php