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.