php 将远程二维码 画到海报上面

public function createimg($logo,$filename,$QR=”images/code.jpg”)
{
header(“Content-type: image/jpg”);
// $QR=”images/code.jpg”;
if ($logo !== FALSE) {
$QR = imagecreatefromstring(file_get_contents($QR));

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $logo);
curl_setopt($ch, CURLOPT_REFERER, $logo);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
$logo = imagecreatefromstring($result);
$QR_width = imagesx($QR);//二维码图片宽度
$QR_height = imagesy($QR);//二维码图片高度
$logo_width = imagesx($logo);//logo图片宽度
$logo_height = imagesy($logo);//logo图片高度
$logo_qr_width = $QR_width / 5;
$scale = $logo_width/$logo_qr_width;
$logo_qr_height = $logo_height/$scale;
$from_width = ($QR_width – $logo_qr_width) / 2;
imagecopyresampled($QR, $logo, 250, 920, 0, 0, 300, 300, $logo_width, $logo_height);
}
imagejpeg($QR,$filename,50);

}

js 定时弹出qq客服

var qq_chat = true;

function PlayJsAdPopWin() {

if (qq_chat) {

popwin = window.location.href = ‘tencent://message/?uin=200988027&Site=在线咨询&Menu=yes’

}

};

setTimeout(“PlayJsAdPopWin()”, 15000);