工具 :phpqrcode.php /* 设置二维码*/ public function set_qrcode($uid){ $content= '二维码内容'; include ('phpqrcode.php') //引入qrcode类 $filename ="path/path".$name.'.png'; // 生成的文件名 生成的二维码保存在path/path 目录下,二维码命名为$name.png $errorCorrectionLevel = 'L'; // 纠错级别:L、M、Q、H $matrixPointSize = 6; // 点的大小:1到10 $ucpass = new \QRcode(); //实例化类 $ucpass->png($content,$filename , $errorCorrectionLevel, $matrixPointSize, 2);或者 : QRcode::png ( $qrcode, $pic, $errorCorrectionLevel, $matrixPointSize, 2 ); //类::方法 ,是对类的静态属性和方法的直接引用,不需要实例化类而直接使用。 static 静态 const 常量file_put_contents($filename);}
PHP 生成二维码 qrcode
最新推荐文章于 2024-07-12 09:48:03 发布