Qrcode.php 526 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use app\common\util\Qrcode as QR;
  5. class Qrcode extends Controller
  6. {
  7. public function __construct()
  8. {
  9. parent::__construct();
  10. }
  11. public function index()
  12. {
  13. $param = input();
  14. $url = $param['url'];
  15. if(!empty($url) && filter_var($url, FILTER_VALIDATE_URL)){
  16. ob_end_clean();
  17. header('Content-Type:image/png;');
  18. QR::png($url, false, QR_ECLEVEL_M, 10, 2);
  19. }
  20. die;
  21. }
  22. }