Skip to content

Instantly share code, notes, and snippets.

View gtnsimon's full-sized avatar

Gaëtan SIMON gtnsimon

View GitHub Profile
@gtnsimon
gtnsimon / ldap_escape.php
Last active June 20, 2016 15:54 — forked from egulhan/ldap_escape.php
ldap_escape() function
/**
* function ldap_escape
* @source http://stackoverflow.com/questions/8560874/php-ldap-add-function-to-escape-ldap-special-characters-in-dn-syntax#answer-8561604
* @author Chris Wright
* @version 2.0
* @param string $subject The subject string
* @param bool $dn Treat subject as a DN if TRUE
* @param string|array $ignore Set of characters to leave untouched
* @return string The escaped string
*/