static function makeBase64URI(string $data) {
        $img = \getimagesizefromstring($data);
        if(!$img) {
            throw new \InvalidArgumentException('Bad input data');
        }
        
        return 'data:'.$img['mime'].';base64,'.\base64_encode($data);
    }
static function makeBase64URI(string $data) {
        $img = \getimagesizefromstring($data);
        if(!$img) {
            throw new \InvalidArgumentException('Bad input data');
        }
        
        return 'data:'.$img['mime'].';base64,'.\base64_encode($data);
    }
static function makeBase64URI ( string $ data ) { $ img = \ getimagesizefromstring ( $ data ) ; if ( ! $ img ) { throw new \ InvalidArgumentException ( 'Bad input data' ) ; } return 'data:' . $ img [ 'mime' ] . ';base64,' . \ base64_encode ( $ data ) ; }
Turns input into a base64-encoded data URI.
@param string  $data
@return string
@throws \InvalidArgumentException
Turns input into a base64 - encoded data URI .