public function toHex($prefixHexContent = false)
    {
        $chars = $this->getPlain();
        if ($prefixHexContent && ctype_xdigit($chars)) {
            return "fe" . $chars;
        }

        $payload = "";
        for ($c = 0, $cnt = strlen($chars); $c < $cnt; $c++ ) {
            $decimal = ord($chars[$c]);
            $hexCode = dechex($decimal);

            // payload is built of *hexits*
            $payload .= str_pad($hexCode, 2, "0", STR_PAD_LEFT);
        }

        $this->payload = strtolower($payload);
        return $this->payload;
    }
public function toHex($prefixHexContent = false)
    {
        $chars = $this->getPlain();
        if ($prefixHexContent && ctype_xdigit($chars)) {
            return "fe" . $chars;
        }

        $payload = "";
        for ($c = 0, $cnt = strlen($chars); $c < $cnt; $c++ ) {
            $decimal = ord($chars[$c]);
            $hexCode = dechex($decimal);

            // payload is built of *hexits*
            $payload .= str_pad($hexCode, 2, "0", STR_PAD_LEFT);
        }

        $this->payload = strtolower($payload);
        return $this->payload;
    }
public function toHex ( $ prefixHexContent = false ) { $ chars = $ this -> getPlain ( ) ; if ( $ prefixHexContent && ctype_xdigit ( $ chars ) ) { return "fe" . $ chars ; } $ payload = "" ; for ( $ c = 0 , $ cnt = strlen ( $ chars ) ; $ c < $ cnt ; $ c ++ ) { $ decimal = ord ( $ chars [ $ c ] ) ; $ hexCode = dechex ( $ decimal ) ; // payload is built of *hexits* $ payload .= str_pad ( $ hexCode , 2 , "0" , STR_PAD_LEFT ) ; } $ this -> payload = strtolower ( $ payload ) ; return $ this -> payload ; }
Helper to retrieve the hexadecimal representation of a message.

@return string
Helper to retrieve the hexadecimal representation of a message .