ldap_escape

PHP 5 >= 5.6.0, PHP 7, PHP 8
ldap_escape - Escape a string for use in an LDAP filter or DN
Manual
Code Examples

Example #1 Searching for an email address

When building an LDAP filter, you should use ldap_escape with LDAP_ESCAPE_FILTER flag.

PHP Version: