二维码转存为图片
Posted pai片儿的
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了二维码转存为图片相关的知识,希望对你有一定的参考价值。
public function index(){ $url = ‘https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=gQEA8TwAAAAAAAAAAS5odHRwOi8vd2VpeGluLn‘; $file = "public/uploads/1.jpg"; $ch = curl_init($url); $fp = fopen($file, ‘wb‘); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); // curl_close($ch); fclose($fp);$fp = fopen($file, ‘wb‘); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); }
以上是关于二维码转存为图片的主要内容,如果未能解决你的问题,请参考以下文章