Generate QR Code

Generate QR code for any string like URL or text.

/**
     * 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
     *
     * @return string containing complete image tag
     */
    public static function getQRcode($string, $width = 150, $height = 150)
    {

        $apiUrl = 'https://chart.apis.google.com/chart?chs=' . $width . 'x' . $height . '&cht=qr&chl=' . urlencode($string);

        return '<img src="' . $apiUrl . '" />';
    }

Loading ...

Related Results :

  1. Generate QR Code
Note :
  • Related Posts are generally User Blog posts.
  • or Other tutorials from other networks of w3clan.com.
  • Any registered user can create related posts based on search term tags.

About the Author