Cakephp 二维码图像发生器

Cakephp 二维码图像发生器,cakephp,qr-code,Cakephp,Qr Code,我正在使用来自的二维码生成器api 下面是用于生成二维码的URL 当我在浏览器中输入URL时,它会返回一个图像。 如何将此图像存储在文件夹中 我正在使用cakephp 我在我的代码中尝试了这个,但它不起作用 $file = new File('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example'); $file->copy('../webroot/img/user_QR/'); 把这样简单

我正在使用来自的二维码生成器api

下面是用于生成二维码的URL

当我在浏览器中输入URL时,它会返回一个图像。 如何将此图像存储在文件夹中

我正在使用cakephp

我在我的代码中尝试了这个,但它不起作用

$file = new File('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example');

$file->copy('../webroot/img/user_QR/');
把这样简单的事情弄清楚

$qrData = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example');
$file = new File('path/to/the-file.jpg', true);
$file->write($qrData);
把这样简单的事情弄清楚

$qrData = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example');
$file = new File('path/to/the-file.jpg', true);
$file->write($qrData);
把这样简单的事情弄清楚

$qrData = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example');
$file = new File('path/to/the-file.jpg', true);
$file->write($qrData);
把这样简单的事情弄清楚

$qrData = file_get_contents('https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=example');
$file = new File('path/to/the-file.jpg', true);
$file->write($qrData);
Thanx。。。它起作用了:)我试过文件内容和文件内容,但都不起作用。Thanx。。。它起作用了:)我试过文件内容和文件内容,但都不起作用。Thanx。。。它起作用了:)我试过文件内容和文件内容,但都不起作用。Thanx。。。它成功了:)我试过文件内容和文件内容,但没有成功。