Adldap\Utilities::unescape PHP Method

unescape() public static method

Un-escapes a hexadecimal string into its original string representation.
public static unescape ( string $value ) : string
$value string
return string
    public static function unescape($value)
    {
        $callback = function ($matches) {
            return chr(hexdec($matches[1]));
        };
        return preg_replace_callback('/\\\\([0-9A-Fa-f]{2})/', $callback, $value);
    }

Usage Example

Example #1
0
 /**
  * Returns the unescaped query.
  *
  * @return string
  */
 public function getUnescapedQuery()
 {
     return Utilities::unescape($this->getQuery());
 }