private function _str2hex($string)
    {
        $hex = bin2hex($string);
        $xhex = "";

        for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
            $xhex .= '\x' . $hex[$i] . $hex[$i + 1];
        }

        return $xhex;
    }
private function _str2hex($string)
    {
        $hex = bin2hex($string);
        $xhex = "";

        for ($i = 0; $i < strlen($hex) - 1; $i += 2) {
            $xhex .= '\x' . $hex[$i] . $hex[$i + 1];
        }

        return $xhex;
    }
private function _str2hex ( $ string ) { $ hex = bin2hex ( $ string ) ; $ xhex = "" ; for ( $ i = 0 ; $ i < strlen ( $ hex ) - 1 ; $ i += 2 ) { $ xhex .= '\x' . $ hex [ $ i ] . $ hex [ $ i + 1 ] ; } return $ xhex ; }
Transform string into hex entities like \xnn

@param string $string The string to be parsed

@return string
Transform string into hex entities like \ xnn