方法一:
file_put_contents(Yii::getAlias('@backend/web/upload/123.jpg'), file_get_contents('https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=alkshduhalskfjasd));
方法二:
$url = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=alkshduhalskfjasd;
$curl = curl_init($url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
$imageData = curl_exec($curl);
curl_close($curl);
$tp = fopen(Yii::$app->basePath . "/runtime/123.jpg","a");
fwrite($tp, $imageData);
fclose($tp);