public static function encodeBase64($str,
        $lineLength = self::LINELENGTH,
        $lineEnd = self::LINEEND)
    {
        return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
    }
public static function encodeBase64($str,
        $lineLength = self::LINELENGTH,
        $lineEnd = self::LINEEND)
    {
        return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
    }
public static function encodeBase64 ( $ str , $ lineLength = self :: LINELENGTH , $ lineEnd = self :: LINEEND ) { return rtrim ( chunk_split ( base64_encode ( $ str ) , $ lineLength , $ lineEnd ) ) ; }
Encode a given string in base64 encoding and break lines
according to the maximum linelength.

@param string $str
@param int $lineLength Defaults to {@link LINELENGTH}
@param int $lineEnd Defaults to {@link LINEEND}
@return string
Encode a given string in base64 encoding and break lines according to the maximum linelength .