Renoir Boulanger Un geek social et Linuxien de nature

Encapsulate a LDAP DN string using Arrays in PHP

While I was writing an authentication and privileges assignation mechanism using information provided by an ActiveDirectory’s LDAP DN string into my project’s web application, I realized that there was no documented way to extract information from it. This snippet is about reading a complex DN string, and “explode” it into a manageable PHP Array.