PHP开发实例大全(提高卷) 中文完整pdf扫描版[244MB]
微信生成独一无的二维码
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2016/6/16
- * Time: 8:26
- */
- $url = "http://www.kuitao8.com/qr/view?qr=www.baidu.com";
- function GetCurl($url){
- $curl = curl_init();
- curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($curl,CURLOPT_URL, $url);
- curl_setopt($curl,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
- $resp = curl_exec($curl);
- curl_close($curl);
- return $resp;
- }
- $content = GetCurl($url);
- preg_match('/<img.+src=\"?(.+\.(jpg|gif|bmp|bnp|png|jpeg))\"?.+>/i',$content,$arr);
- $imgFile = "http://www.kuitao8.com/".$arr[1];
- if(isset($_GET['url'])){
- $xx = $_GET['url'].'.jpg';
- }else{
- $xx= "xxx.jpg";
- }
- file_put_contents($xx,GetCurl($imgFile));
转载请注明:谷谷点程序 » php微信生成独一无的二维码