public static function getQRcode($string, $width = 150, $height = 150, $attributes = [])
    {
        $protocol = 'http://';
        if (self::isHttps()) {
            $protocol = 'https://';
        }

        $attr = trim(self::arrayToString($attributes));
        $apiUrl = $protocol.'chart.apis.google.com/chart?chs='.$width.'x'.$height.'&cht=qr&chl='.urlencode($string);

        return '<img src="'.$apiUrl.'" '.$attr.' />';
    }
public static function getQRcode($string, $width = 150, $height = 150, $attributes = [])
    {
        $protocol = 'http://';
        if (self::isHttps()) {
            $protocol = 'https://';
        }

        $attr = trim(self::arrayToString($attributes));
        $apiUrl = $protocol.'chart.apis.google.com/chart?chs='.$width.'x'.$height.'&cht=qr&chl='.urlencode($string);

        return '<img src="'.$apiUrl.'" '.$attr.' />';
    }
public static function getQRcode ( $ string , $ width = 150 , $ height = 150 , $ attributes = [ ] ) { $ protocol = 'http://' ; if ( self :: isHttps ( ) ) { $ protocol = 'https://' ; } $ attr = trim ( self :: arrayToString ( $ attributes ) ) ; $ apiUrl = $ protocol . 'chart.apis.google.com/chart?chs=' . $ width . 'x' . $ height . '&cht=qr&chl=' . urlencode ( $ string ) ; return '<img src="' . $ apiUrl . '" ' . $ attr . ' />' ; }
Get a QR code.

@param string $string     String to generate QR code for.
@param int    $width      QR code width
@param int    $height     QR code height
@param array  $attributes Optional, additional key/value attributes to include in the IMG tag

@return string containing complete image tag
Get a QR code .