src/IrcParser.php
protected static function ctcpUnquote($msg)
    {
        // CTCP-level unquoting
        $quoting = array(
            "\\a"   => "\001",
            "\\\\"  => "\\",
            "\\"    => "",  // Ignore quoting character
                            // for invalid sequences.
        );
        $msg = strtr($msg, $quoting);

        // Low-level unquoting
        $quoting = array(
            "\0200"     => "\000",
            "\020n"     => "\n",
            "\020r"     => "\r",
            "\020\020"  => "\020",
            "\020"      => "",  // Ignore quoting character
                                // for invalid sequences.
        );
        $msg = strtr($msg, $quoting);
        return $msg;
    }
protected static function ctcpUnquote($msg)
    {
        // CTCP-level unquoting
        $quoting = array(
            "\\a"   => "\001",
            "\\\\"  => "\\",
            "\\"    => "",  // Ignore quoting character
                            // for invalid sequences.
        );
        $msg = strtr($msg, $quoting);

        // Low-level unquoting
        $quoting = array(
            "\0200"     => "\000",
            "\020n"     => "\n",
            "\020r"     => "\r",
            "\020\020"  => "\020",
            "\020"      => "",  // Ignore quoting character
                                // for invalid sequences.
        );
        $msg = strtr($msg, $quoting);
        return $msg;
    }
protected static function ctcpUnquote ( $ msg ) { // CTCP-level unquoting $ quoting = array ( "\\a" => "\001" , "\\\\" => "\\" , "\\" => "" , // Ignore quoting character // for invalid sequences. ) ; $ msg = strtr ( $ msg , $ quoting ) ; // Low-level unquoting $ quoting = array ( "\0200" => "\000" , "\020n" => "\n" , "\020r" => "\r" , "\020\020" => "\020" , "\020" => "" , // Ignore quoting character // for invalid sequences. ) ; $ msg = strtr ( $ msg , $ quoting ) ; return $ msg ; }
Unquotes a CTCP message.

\param string $msg
Some CTCP message to unquote.

\retval string
The message, with CTCP quoting removed.

\see
http://www.irchelp.org/irchelp/rfc/ctcpspec.html
Unquotes a CTCP message .