Hoa central
Base64.php
Go to the documentation of this file.
1 <?php
2 
38 
39 use Hoa\Mail;
40 
50 class Base64 implements Encoder
51 {
59  public static function encode($string, $isHeaderValue = false)
60  {
61  $pre = null;
62  $post = null;
63 
64  if (true === $isHeaderValue) {
65  $pre = '=?utf-8?B?';
66  $post = '?=';
67  }
68 
69  return
70  $pre .
71  trim(
72  chunk_split(
73  base64_encode($string),
74  76,
75  CRLF
76  )
77  ) .
78  $post;
79  }
80 
88  public static function decode($string, $isHeaderValue = false)
89  {
90  throw new Mail\Exception('Not implemented.', 0);
91  }
92 }
static decode($string, $isHeaderValue=false)
Definition: Base64.php:88
static encode($string, $isHeaderValue=false)
Definition: Base64.php:59