note 124751 deleted from function.ldap-escape by cmb
| From: | cmb@php.net | Date: | Mon, 24 Feb 2020 21:15:38 +0000 |
| Subject: | note 124751 deleted from function.ldap-escape by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-214216@lists.php.net to get a copy of this message | ||
Note Submitter: support at extollit dot com
----
Suppose you want to reverse the operation, here is a way to "ldap_unescape"
function ldap_unescape($string) {
return
preg_replace_callback(
"/\\\\\\\\[\da-z]{2}/",
function ($matches) {
$match = array_shift($matches);
return hex2bin(substr($match, 2));
},
$string
);
}
ldap_unescape("uid=\\\\6a\\\\6f\\\\6e\\\\61\\\\74\\\\68\\\\61\\\\6e,ou=people,dc=extollit,dc=com");