ConFoo Montreal 2026: Call for Papers

Voting

: min(nine, eight)?
(Example: nine)

The Note You're Voting On

hp at syntomax dot com
20 years ago
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.

<< Back to user notes page

To Top