public function get($format = 'png')
    {
        $this->create();

        if ($format == 'jpg') {
            $format = 'jpeg';
        }

        if (!in_array($format, $this->image_types_available)) {
            $format = $this->image_type;
        }

        if (!function_exists('image'.$format)) {
            throw new Exception('QRCode: function image'.$format.' does not exists.');
        }

        ob_start();
        $success = call_user_func('image'.$format, $this->image);

        if ($success === false) {
            throw new Exception('QRCode: function image'.$format.' failed.');
        }

        $content = ob_get_clean();

        return $content;
    }
public function get($format = 'png')
    {
        $this->create();

        if ($format == 'jpg') {
            $format = 'jpeg';
        }

        if (!in_array($format, $this->image_types_available)) {
            $format = $this->image_type;
        }

        if (!function_exists('image'.$format)) {
            throw new Exception('QRCode: function image'.$format.' does not exists.');
        }

        ob_start();
        $success = call_user_func('image'.$format, $this->image);

        if ($success === false) {
            throw new Exception('QRCode: function image'.$format.' failed.');
        }

        $content = ob_get_clean();

        return $content;
    }
public function get ( $ format = 'png' ) { $ this -> create ( ) ; if ( $ format == 'jpg' ) { $ format = 'jpeg' ; } if ( ! in_array ( $ format , $ this -> image_types_available ) ) { $ format = $ this -> image_type ; } if ( ! function_exists ( 'image' . $ format ) ) { throw new Exception ( 'QRCode: function image' . $ format . ' does not exists.' ) ; } ob_start ( ) ; $ success = call_user_func ( 'image' . $ format , $ this -> image ) ; if ( $ success === false ) { throw new Exception ( 'QRCode: function image' . $ format . ' failed.' ) ; } $ content = ob_get_clean ( ) ; return $ content ; }
Create QR Code and return its raw content.

@param string|null $format Image type (gif, png, wbmp, jpeg)

@throws Exception

@return string img raw content
Create QR Code and return its raw content .