php 生成二维码以后,修改保存图片地址

2025-02-24 05:23:18
推荐回答(1个)
回答1:

指定调用函数的第二个参数,是文件存储地址。

        public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) 
        {
            $enc = QRencode::factory($level, $size, $margin);
            return $enc->encodePNG($text, $outfile, $saveandprint=false);
        }

 

如: \QRcode::png($str, $file);