note 46974 added to function.ldap-add

From: Date: Fri, 29 Oct 2004 01:31:59 +0000
Subject: note 46974 added to function.ldap-add
Groups: php.notes 
Request: Send a blank email to php-notes+get-79298@lists.php.net to get a copy of this message
Another fun thing: ldap_add() doesn't like arrays with empty members: so array ( [cn] = "name" [key] = "" [anotherkey] = "value" ) will yield a syntax error! solve this with a simple peice of code: foreach ($originalobject as $key => $value){ if ($value != ""){ $object[$key] = $value; } } where $originalobject is the uncecked array and $object is the one without empty members. ---- Manual Page -- http://www.php.net/manual/en/function.ldap-add.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+46974 Delete -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46974&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+46974&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#79298) next »