You are here

function ldap_pear_hex2asc in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.2 ldap_servers/ldap_servers.functions.inc \ldap_pear_hex2asc()
  2. 7 ldap_servers/ldap_servers.functions.inc \ldap_pear_hex2asc()

Converts all Hex expressions ("\HEX") to their original ASCII characters

@static @author beni@php.net, heavily based on work from DavidSmith@byu.net

Parameters

string $string String to convert:

Return value

string

2 calls to ldap_pear_hex2asc()
ldap_pear_unescape_dn_value in ldap_servers/ldap_servers.functions.inc
Undoes the conversion done by escape_dn_value().
ldap_pear_unescape_filter_value in ldap_servers/ldap_servers.functions.inc
Undoes the conversion done by {@link escape_filter_value()}.

File

ldap_servers/ldap_servers.functions.inc, line 378
collection of functions that don't belong in server object

Code

function ldap_pear_hex2asc($string) {
  $string = preg_replace("/\\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''", $string);
  return $string;
}