First, place the path as shown in the picture.
Simple use without logo:
public function qrcode(){ Vendor('phpqrcode.phpqrcode'); //生成二维码图片 $object = new \QRcode(); $url='http://www.shouce.ren/';//网址或者是文本内容 $level=3; $size=4; $errorCorrectionLevel =intval($level) ;//容错级别 $matrixPointSize = intval($size);//生成图片大小 $object->png($url, false, $errorCorrectionLevel, $matrixPointSize, 2); }
Advanced use with logo:
public function qrcode(){ Vendor('phpqrcode.phpqrcode'); //生成二维码图片 $object = new \QRcode(); $qrcode_path=''; $file_tmp_name=''; $errors=array(); if(!empty($_POST)){ $content = trim($_POST['content']); //二维码内容 $c if($contentSize>150){ $errors[]='字数过长,不能多于150个字符!'; } if(isset($_FILES['upimage']['tmp_name']) && $_FILES['upimage']['tmp_name'] && is_uploaded_file($_FILES['upimage']['tmp_name'])){ if($_FILES['upimage']['size']>512000){ $errors[]="你上传的文件过大,最大不能超过500K。"; } $file_tmp_name=$_FILES['upimage']['tmp_name']; $fileext = array("image/pjpeg","image/jpeg","image/gif","image/x-png","image/png"); if(!in_array($_FILES['upimage']['type'],$fileext)){ $errors[]="你上传的文件格式不正确,仅支持 png, jpg, gif格式。"; } } $tpgs=$_POST['tpgs'];//图片格式 $qrcode_bas_path='upload/qrcode/'; if(!is_dir($qrcode_bas_path)){ mkdir($qrcode_bas_path, 0777, true); } $uniqid_rand=date("Ymdhis").uniqid(). rand(1,1000); $qrcode_path=$qrcode_bas_path.$uniqid_rand. "_1.".$tpgs;//原始图片路径 $qrcode_path_new=$qrcode_bas_path.$uniqid_rand."_2.".$tpgs;//二维码图片路径 if(Helper::getOS()=='Linux'){ $mv = move_uploaded_file($file_tmp_name, $qrcode_path); }else{ //解决windows下中文文件名乱码的问题 $save_path = Helper::safeEncoding($qrcode_path,'GB2312'); if(!$save_path){ $errors[]='上传失败,请重试!'; } $mv = move_uploaded_file($file_tmp_name, $qrcode_path); } if(empty($errors)){ $errorCorrectionLevel = $_POST['errorCorrectionLevel'];//容错级别 $matrixPointSize = $_POST['matrixPointSize'];//生成图片大小 $matrixMarginSize = $_POST['matrixMarginSize'];//边距大小 //生成二维码图片 $object::png($content,$qrcode_path_new, $errorCorrectionLevel, $matrixPointSize, $matrixMarginSize); $QR = $qrcode_path_new;//已经生成的原始二维码图 $logo = $qrcode_path;//准备好的logo图片 if (file_exists($logo)) { $QR = imagecreatefromstring(file_get_contents($QR)); $logo = imagecreatefromstring(file_get_contents($logo)); $QR_width = imagesx($QR);//二维码图片宽度 $QR_height = imagesy($QR);//二维码图片高度 $logo_width = imagesx($logo);//logo图片宽度 $logo_height = imagesy($logo);//logo图片高度 $logo_qr_width = $QR_width / 5; $scale = $logo_width/$logo_qr_width; $logo_qr_height = $logo_height/$scale; $from_width = ($QR_width - $logo_qr_width) / 2; //重新组合图片并调整大小 imagecopyresampled($QR, $logo, $from_width, $from_width, 0, 0, $logo_qr_width, $logo_qr_height, $logo_width, $logo_height); //输出图片 //header("Content-type: image/png"); imagepng($QR,$qrcode_path); imagedestroy($QR); }else{ $qrcode_path=$qrcode_path_new; } }else{ $qrcode_path=''; } } $data=array('data'=>array('errors'=>$errors,'qrcode_path'=>$qrcode_path)); $this->assign('data',$data); $this->display();
Demo address: http://www.shouce.ren/tool/qrcode
Use the assistant class Helper address: http://www.thinkphp.cn/topic/34875.html
The above introduces the QR code of ThinkPHP323 extension, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Linux系统如何设置PATH环境变量在Linux系统中,PATH环境变量用于指定系统在命令行中搜索可执行文件的路径。正确设置PATH环境变量可以方便我们在任何位置执行系统命令和自定义命令。本文将介绍如何在Linux系统中设置PATH环境变量,并提供详细的代码示例。查看当前的PATH环境变量在终端中执行以下命令,可以查看当前的PATH环境变量:echo$P

在html5中,width的意思是宽度,width属性定义元素内容区的宽度,在内容区外面可以增加内边距、边框和外边距,只需要给元素设置“元素{width:数值}”即可。

设置path环境变量的方法:1、Windows系统,打开“系统属性”,点击“属性”选项,点击“高级系统设置”,在“系统属性”窗口中,选择“高级”标签,然后点击“环境变量”按钮,找到并点击“Path”编辑保存后即可;2、Linux系统,打开终端,打开你的bash配置文件,在文件末尾添加“export PATH=$PATH:文件路径”保存即可;3、MacOS系统,操作同上。

iwatch只亮logo不开机的原因及解决办法:1、电量不足无法开机导致的,可以把iwatch的背面放在充电器上;2、系统版本问题导致的,可以把系统回退到稳定版本;3、充电器或充电线故障导致的,可以使用另一根iwatch磁性充电线缆和另一个USB电源适配器;4、硬件故障导致的,建议到专业第三方检测机机构检修。

如何正确设置Linux中的PATH环境变量在Linux操作系统中,环境变量是用来存储系统级别的配置信息的重要机制之一。其中,PATH环境变量被用来指定系统在哪些目录中查找可执行文件。正确设置PATH环境变量是确保系统正常运行的关键一步。本文将介绍如何正确设置Linux中的PATH环境变量,并提供具体的代码示例。1.查看当前PATH环境变量在终端中输入以下命

8月29日,福田汽车举办了一场华丽的品牌焕新发布会,给业界带来了一系列令人振奋的消息。新的标志、欧曼智蓝底部换电产品以及全新的祥菱Q汽车成为了发布会的关注焦点福田汽车的新标志展示了公司对未来的雄心壮志。福田汽车表示,这个全新的标志象征着品牌的更新和蓬勃发展,标志着公司进入了新的发展阶段在发布会上,福田汽车还推出了备受瞩目的欧曼智蓝底部换电产品,为用户带来了更便捷、高效的使用体验。同时,全新推出的祥菱Q汽车系列也吸引了众多目光,共有4款车型,售价从16.78万元到16.88万元不等,为消费者提供了

配置步骤:1、找到Java安装目录;2、找到系统的环境变量设置;3、在环境变量窗口中,找到名为“Path”的变量,并点击编辑按钮;4、在弹出的编辑环境变量窗口中,点击“新建”按钮,并在弹出的对话框中输入Java的安装路径;5、确认输入正确后,点击“确定”按钮即可。

《Linux中PATH环境变量的作用和重要性》PATH环境变量是Linux系统中非常重要的环境变量之一,它定义了系统在哪些目录中寻找可执行程序。在Linux系统中,当用户在终端输入一个命令时,系统会在PATH环境变量所列出的目录中逐个查找是否存在该命令的可执行文件,如果找到则执行,否则会提示“commandnotfound”。PATH环境变量的作用:简化


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Zend Studio 13.0.1
Powerful PHP integrated development environment
