public static function encode($text, $eol = "\n", $wrap = 76)
    {
        $fp = fopen('php://temp', 'r+');
        stream_filter_append(
            $fp,
            'convert.quoted-printable-encode',
            STREAM_FILTER_WRITE,
            array(
                'line-break-chars' => $eol,
                'line-length' => $wrap
            )
        );
        fwrite($fp, $text);
        rewind($fp);
        $out = stream_get_contents($fp);
        fclose($fp);

        return $out;
    }
public static function encode($text, $eol = "\n", $wrap = 76)
    {
        $fp = fopen('php://temp', 'r+');
        stream_filter_append(
            $fp,
            'convert.quoted-printable-encode',
            STREAM_FILTER_WRITE,
            array(
                'line-break-chars' => $eol,
                'line-length' => $wrap
            )
        );
        fwrite($fp, $text);
        rewind($fp);
        $out = stream_get_contents($fp);
        fclose($fp);

        return $out;
    }
public static function encode ( $ text , $ eol = "\n" , $ wrap = 76 ) { $ fp = fopen ( 'php://temp' , 'r+' ) ; stream_filter_append ( $ fp , 'convert.quoted-printable-encode' , STREAM_FILTER_WRITE , array ( 'line-break-chars' => $ eol , 'line-length' => $ wrap ) ) ; fwrite ( $ fp , $ text ) ; rewind ( $ fp ) ; $ out = stream_get_contents ( $ fp ) ; fclose ( $ fp ) ; return $ out ; }
Encodes text via quoted-printable encoding.

@param string $text   The text to encode (UTF-8).
@param string $eol    The EOL sequence to use.
@param integer $wrap  Wrap a line at this many characters.

@return string  The quoted-printable encoded string.
Encodes text via quoted - printable encoding .