Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Endroid\QR码_Php_Qr Code - Fatal编程技术网

Php Endroid\QR码

Php Endroid\QR码,php,qr-code,Php,Qr Code,生成二维码后,如何将二维码保存在特定文件夹中 下面是我使用此处找到的库生成qrcode的示例代码: 有点晚,但请尝试以下方法: //... $qr ->setText('Hello Kent') ->setSize(140) ->setPadding(10) ->setErrorCorrection('high') ->setForegroundColor(array('r' => 0, 'g'

生成二维码后,如何将二维码保存在特定文件夹中

下面是我使用此处找到的库生成qrcode的示例代码:


有点晚,但请尝试以下方法:

//...
$qr ->setText('Hello Kent')
        ->setSize(140)
        ->setPadding(10)
        ->setErrorCorrection('high')
        ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
        ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
        ->setLabel('My label')
        ->setLabelFontSize(16)
        ->setImageType(IMAGE_TYPE_PNG);

$file_name = '/path/to/myfile.png';
$qr->writeFile($file_name);

你认为setImagePath()能做什么?先生,我只是在尝试那种方法,但不起作用。。我还尝试了setPath(),得到了相同的结果。先生,你知道怎么解决这个问题吗?
//...
$qr ->setText('Hello Kent')
        ->setSize(140)
        ->setPadding(10)
        ->setErrorCorrection('high')
        ->setForegroundColor(array('r' => 0, 'g' => 0, 'b' => 0, 'a' => 0))
        ->setBackgroundColor(array('r' => 255, 'g' => 255, 'b' => 255, 'a' => 0))
        ->setLabel('My label')
        ->setLabelFontSize(16)
        ->setImageType(IMAGE_TYPE_PNG);

$file_name = '/path/to/myfile.png';
$qr->writeFile($file_name);