热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

微信卡券-功能接口(更新接口)-PHP源码

微信卡券-功能接口(更新接口)

1. [代码]JSAPI前端 跳至

wxOauthAccessToken($CODE);
        //print_r($Info);
    //    $openId = $Info['openid'];    
    //}
    ////////////////////////////////////////////

    $signPackage = $wx->wxJsapiPackage();
    //print_r($signPackage);
    $kqInfo = $wx->wxCardPackage("***************");
    $listInfo = $wx->wxCardListPackage();
?>

    
        
        
        
        
        
        
    
    
        




2. [代码]微信API类 跳至 [1] [2] [全屏预览]


     *		@link https://www.php1.cn/
     *		@version 2.0.1
     *		@uses $wxApi = new WxApi();
     *		@package 微信API接口 陆续会继续进行更新
     ********************************************************/

    class WxApi {
        const appId         = "";
        const appSecret     = "";
        const mchid         = ""; //商户号
        const privatekey    = ""; //私钥
        public $parameters  = array();
        public $jsApiTicket = NULL;
        public $jsApiTime   = NULL;

        public function __construct(){

        }

        /****************************************************
         *	微信提交API方法,返回微信指定JSON
         ****************************************************/

        public function wxHttpsRequest($url,$data = null){
                $curl = curl_init();
                curl_setopt($curl, CURLOPT_URL, $url);
                curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
                curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
                if (!empty($data)){
                        curl_setopt($curl, CURLOPT_POST, 1);
                        curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
                }
                curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
                $output = curl_exec($curl);
                curl_close($curl);
                return $output;
        }

        /****************************************************
         *  微信带证书提交数据 - 微信红包使用
         ****************************************************/

        public function wxHttpsRequestPem($url, $vars, $secOnd=30,$aHeader=array()){
                $ch = curl_init();
                //超时时间
                curl_setopt($ch,CURLOPT_TIMEOUT,$second);
                curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
                //这里设置代理,如果有的话
                //curl_setopt($ch,CURLOPT_PROXY, '10.206.30.98');
                //curl_setopt($ch,CURLOPT_PROXYPORT, 8080);
                curl_setopt($ch,CURLOPT_URL,$url);
                curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
                curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,false);

                //以下两种方式需选择一种

                //第一种方法,cert 与 key 分别属于两个.pem文件
                //默认格式为PEM,可以注释
                curl_setopt($ch,CURLOPT_SSLCERTTYPE,'PEM');
                curl_setopt($ch,CURLOPT_SSLCERT,getcwd().'/apiclient_cert.pem');
                //默认格式为PEM,可以注释
                curl_setopt($ch,CURLOPT_SSLKEYTYPE,'PEM');
                curl_setopt($ch,CURLOPT_SSLKEY,getcwd().'/apiclient_key.pem');

                curl_setopt($ch,CURLOPT_CAINFO,'PEM');
                curl_setopt($ch,CURLOPT_CAINFO,getcwd().'/rootca.pem');

                //第二种方式,两个文件合成一个.pem文件
                //curl_setopt($ch,CURLOPT_SSLCERT,getcwd().'/all.pem');

                if( count($aHeader) >= 1 ){
                        curl_setopt($ch, CURLOPT_HTTPHEADER, $aHeader);
                }

                curl_setopt($ch,CURLOPT_POST, 1);
                curl_setopt($ch,CURLOPT_POSTFIELDS,$vars);
                $data = curl_exec($ch);
                if($data){
                        curl_close($ch);
                        return $data;
                }
                else { 
                        $error = curl_errno($ch);
                        echo "call faild, errorCode:$error\n"; 
                        curl_close($ch);
                        return false;
                }
        }

        /****************************************************
         *	微信获取AccessToken 返回指定微信公众号的at信息
         ****************************************************/

        public function wxAccessToken($appId = NULL , $appSecret = NULL){
                $appId 			= is_null($appId) ? self::appId : $appId;
                $appSecret 		= is_null($appSecret) ? self::appSecret : $appSecret;
				
				$url 			= "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appId."&secret=".$appSecret;
				$result 		= $this->wxHttpsRequest($url);
				//print_r($result);
				$jsOninfo= json_decode($result, true);
				$access_token 	= $jsoninfo["access_token"];
                
                return $access_token;
        }

        /****************************************************
         *	微信获取ApiTicket 返回指定微信公众号的at信息
         ****************************************************/

        public function wxJsApiTicket($appId = NULL , $appSecret = NULL){
                $appId 			= is_null($appId) ? self::appId : $appId;
                $appSecret 		= is_null($appSecret) ? self::appSecret : $appSecret;
                
                $url 		    = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?type=jsapi&access_token=".$this->wxAccessToken();
				$result 		= $this->wxHttpsRequest($url);
				$jsOninfo= json_decode($result, true);
				$ticket         = $jsoninfo['ticket'];
                //echo $ticket . "
"; return $ticket; } public function wxVerifyJsApiTicket($appId = NULL , $appSecret = NULL){ if(!empty($this->jsApiTime) && intval($this->jsApiTime) > time() && !empty($this->jsApiTicket)){ $ticket = $this->jsApiTicket; } else{ $ticket = $this->wxJsApiTicket($appId,$appSecret); $this->jsApiTicket = $ticket; $this->jsApiTime = time() + 7200; } return $ticket; } /**************************************************** * 微信通过OPENID获取用户信息,返回数组 ****************************************************/ public function wxGetUser($openId){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=".$wxAccessToken."&openid=".$openId."&lang=zh_CN"; $result = $this->wxHttpsRequest($url); $jsOninfo= json_decode($result, true); return $jsoninfo; } /**************************************************** * 微信生成二维码ticket ****************************************************/ public function wxQrCodeTicket($jsonData){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=".$wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); return $result; } /**************************************************** * 微信通过ticket生成二维码 ****************************************************/ public function wxQrCode($ticket){ $url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" . urlencode($ticket); return $url; } /**************************************************** * 发送自定义的模板消息 ****************************************************/ public function wxSetSend($touser, $template_id, $url, $data, $topcolor = &#39;#7B68EE&#39;){ $template = array( &#39;touser&#39; => $touser, &#39;template_id&#39; => $template_id, &#39;url&#39; => $url, &#39;topcolor&#39; => $topcolor, &#39;data&#39; => $data ); $jsOnData= json_encode($template); $result = $this->wxSendTemplate($jsonData); return $result; } /**************************************************** * 微信设置OAUTH跳转URL,返回字符串信息 - SCOPE = snsapi_base //验证时不返回确认页面,只能获取OPENID ****************************************************/ public function wxOauthBase($redirectUrl,$state = "",$appId = NULL){ $appId = is_null($appId) ? self::appId : $appId; $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appId."&redirect_uri=".$redirectUrl."&response_type=code&scope=snsapi_base&state=".$state."#wechat_redirect"; return $url; } /**************************************************** * 微信设置OAUTH跳转URL,返回字符串信息 - SCOPE = snsapi_userinfo //获取用户完整信息 ****************************************************/ public function wxOauthUserinfo($redirectUrl,$state = "",$appId = NULL){ $appId = is_null($appId) ? self::appId : $appId; $url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=".$appId."&redirect_uri=".$redirectUrl."&response_type=code&scope=snsapi_userinfo&state=".$state."#wechat_redirect"; return $url; } /**************************************************** * 微信OAUTH跳转指定URL ****************************************************/ public function wxHeader($url){ header("location:".$url); } /**************************************************** * 微信通过OAUTH返回页面中获取AT信息 ****************************************************/ public function wxOauthAccessToken($code,$appId = NULL , $appSecret = NULL){ $appId = is_null($appId) ? self::appId : $appId; $appSecret = is_null($appSecret) ? self::appSecret : $appSecret; $url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=".$appId."&secret=".$appSecret."&code=".$code."&grant_type=authorization_code"; $result = $this->wxHttpsRequest($url); //print_r($result); $jsOninfo= json_decode($result, true); //$access_token = $jsoninfo["access_token"]; return $jsoninfo; } /**************************************************** * 微信通过OAUTH的Access_Token的信息获取当前用户信息 // 只执行在snsapi_userinfo模式运行 ****************************************************/ public function wxOauthUser($OauthAT,$openId){ $url = "https://api.weixin.qq.com/sns/userinfo?access_token=".$OauthAT."&openid=".$openId."&lang=zh_CN"; $result = $this->wxHttpsRequest($url); $jsOninfo= json_decode($result, true); return $jsoninfo; } /***************************************************** * 生成随机字符串 - 最长为32位字符串 *****************************************************/ public function wxNonceStr($length = 16, $type = FALSE) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $str = ""; for ($i = 0; $i <$length; $i++) { $str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1); } if($type == TRUE){ return strtoupper(md5(time() . $str)); } else { return $str; } } /******************************************************* * 微信商户订单号 - 最长28位字符串 *******************************************************/ public function wxMchBillno($mchid = NULL) { if(is_null($mchid)){ if(self::mchid == "" || is_null(self::mchid)){ $mchid = time(); } else{ $mchid = self::mchid; } } else{ $mchid = substr(addslashes($mchid),0,10); } return date("Ymd",time()).time().$mchid; } /******************************************************* * 微信格式化数组变成参数格式 - 支持url加密 *******************************************************/ public function wxSetParam($parameters){ if(is_array($parameters) && !empty($parameters)){ $this->parameters = $parameters; return $this->parameters; } else{ return array(); } } /******************************************************* * 微信格式化数组变成参数格式 - 支持url加密 *******************************************************/ public function wxFormatArray($parameters = NULL, $urlencode = FALSE){ if(is_null($parameters)){ $parameters = $this->parameters; } $restr = "";//初始化空 ksort($parameters);//排序参数 foreach ($parameters as $k => $v){//循环定制参数 if (null != $v && "null" != $v && "sign" != $k) { if($urlencode){//如果参数需要增加URL加密就增加,不需要则不需要 $v = urlencode($v); } $restr .= $k . "=" . $v . "&";//返回完整字符串 } } if (strlen($restr) > 0) {//如果存在数据则将最后“&”删除 $restr = substr($restr, 0, strlen($restr)-1); } return $restr;//返回字符串 } /******************************************************* * 微信MD5签名生成器 - 需要将参数数组转化成为字符串[wxFormatArray方法] *******************************************************/ public function wxMd5Sign($content, $privatekey){ try { if (is_null($privatekey)) { throw new Exception("财付通签名key不能为空!"); } if (is_null($content)) { throw new Exception("财付通签名内容不能为空"); } $signStr = $content . "&key=" . $privatekey; return strtoupper(md5($signStr)); } catch (Exception $e) { die($e->getMessage()); } } /******************************************************* * 微信Sha1签名生成器 - 需要将参数数组转化成为字符串[wxFormatArray方法] *******************************************************/ public function wxSha1Sign($content){ try { if (is_null($content)) { throw new Exception("签名内容不能为空"); } //$signStr = $content; return sha1($content); } catch (Exception $e) { die($e->getMessage()); } } /******************************************************* * 微信jsApi整合方法 - 通过调用此方法获得jsapi数据 *******************************************************/ public function wxJsapiPackage(){ $jsapi_ticket = $this->wxVerifyJsApiTicket(); // 注意 URL 一定要动态获取,不能 hardcode. $protocol = (!empty($_SERVER[&#39;HTTPS&#39;]) && $_SERVER[&#39;HTTPS&#39;] !== &#39;off&#39; || $_SERVER[&#39;SERVER_PORT&#39;] == 443) ? "https://" : "http://"; $url = $protocol.$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; $timestamp = time(); $nOnceStr= $this->wxNonceStr(); $signPackage = array( "jsapi_ticket" => $jsapi_ticket, "nonceStr" => $nonceStr, "timestamp" => $timestamp, "url" => $url ); // 这里参数的顺序要按照 key 值 ASCII 码升序排序 $rawString = "jsapi_ticket=$jsapi_ticket&nOncestr=$nonceStr×tamp=$timestamp&url=$url"; //$rawString = $this->wxFormatArray($signPackage); $signature = $this->wxSha1Sign($rawString); $signPackage[&#39;signature&#39;] = $signature; $signPackage[&#39;rawString&#39;] = $rawString; $signPackage[&#39;appId&#39;] = self::appId; return $signPackage; } /******************************************************* * 微信卡券:JSAPI 卡券Package - 基础参数没有附带任何值 - 再生产环境中需要根据实际情况进行修改 *******************************************************/ public function wxCardPackage($cardId , $timestamp = &#39;&#39;){ $api_ticket = $this->wxVerifyJsApiTicket(); if(!empty($timestamp)){ $timestamp = $timestamp; } else{ $timestamp = time(); } $arrays = array(self::appSecret,$timestamp,$cardId); sort($arrays , SORT_STRING); //print_r($arrays); //echo implode("",$arrays)."
"; $string = sha1(implode($arrays)); //echo $string; $resultArray[&#39;cardId&#39;] = $cardId; $resultArray[&#39;cardExt&#39;] = array(); $resultArray[&#39;cardExt&#39;][&#39;code&#39;] = &#39;&#39;; $resultArray[&#39;cardExt&#39;][&#39;openid&#39;] = &#39;&#39;; $resultArray[&#39;cardExt&#39;][&#39;timestamp&#39;] = $timestamp; $resultArray[&#39;cardExt&#39;][&#39;signature&#39;] = $string; //print_r($resultArray); return $resultArray; } /******************************************************* * 微信卡券:JSAPI 卡券全部卡券 Package *******************************************************/ public function wxCardAllPackage($cardIdArray = array(),$timestamp = &#39;&#39;){ $reArrays = array(); if(!empty($cardIdArray) && (is_array($cardIdArray) || is_object($cardIdArray))){ //print_r($cardIdArray); foreach($cardIdArray as $value){ //print_r($this->wxCardPackage($value,$openid)); $reArrays[] = $this->wxCardPackage($value,$timestamp); } //print_r($reArrays); } else{ $reArrays[] = $this->wxCardPackage($cardIdArray,$timestamp); } return strval(json_encode($reArrays)); } /******************************************************* * 微信卡券:获取卡券列表 *******************************************************/ public function wxCardListPackage($cardType = "" , $cardId = ""){ //$api_ticket = $this->wxVerifyJsApiTicket(); $resultArray = array(); $timestamp = time(); $nOnceStr= $this->wxNonceStr(); //$strings = $arrays = array(self::appId,self::appSecret,$timestamp,$nonceStr); sort($arrays , SORT_STRING); $string = sha1(implode($arrays)); $resultArray[&#39;app_id&#39;] = self::appId; $resultArray[&#39;card_sign&#39;] = $string; $resultArray[&#39;time_stamp&#39;] = $timestamp; $resultArray[&#39;nonce_str&#39;] = $nonceStr; $resultArray[&#39;card_type&#39;] = $cardType; $resultArray[&#39;card_id&#39;] = $cardId; return $resultArray; } /******************************************************* * 将数组解析XML - 微信红包接口 *******************************************************/ public function wxArrayToXml($parameters = NULL){ if(is_null($parameters)){ $parameters = $this->parameters; } if(!is_array($parameters) || empty($parameters)){ die("参数不为数组无法解析"); } $xml = ""; foreach ($arr as $key=>$val) { if (is_numeric($val)) { $xml.="<".$key.">".$val.""; } else $xml.="<".$key.">"; } $xml.=""; return $xml; } /******************************************************* * 微信卡券:上传LOGO - 需要改写动态功能 *******************************************************/ public function wxCardUpdateImg() { $wxAccessToken = $this->wxAccessToken(); //$data[&#39;access_token&#39;] = $wxAccessToken; $data[&#39;buffer&#39;] = &#39;@D:\\workspace\\htdocs\\yky_test\\logo.jpg&#39;; $url = "https://api.weixin.qq.com/cgi-bin/media/uploadimg?access_token=".$wxAccessToken; $result = $this->wxHttpsRequest($url,$data); $jsOninfo= json_decode($result, true); return $jsoninfo; //array(1) { ["url"]=> string(121) "http://mmbiz.qpic.cn/mmbiz/ibuYxPHqeXePNTW4ATKyias1Cf3zTKiars9PFPzF1k5icvXD7xW0kXUAxHDzkEPd9micCMCN0dcTJfW6Tnm93MiaAfRQ/0" } } /******************************************************* * 微信卡券:获取颜色 *******************************************************/ public function wxCardColor(){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/getcolors?access_token=".$wxAccessToken; $result = $this->wxHttpsRequest($url); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:创建卡券 *******************************************************/ public function wxCardCreated($jsonData) { $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/create?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:查询卡券详情 *******************************************************/ public function wxCardGetInfo($jsonData) { $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/get?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:设置白名单 *******************************************************/ public function wxCardWhiteList($jsonData){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/testwhitelist/set?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:消耗卡券 *******************************************************/ public function wxCardConsume($jsonData){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/code/consume?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:删除卡券 *******************************************************/ public function wxCardDelete($jsonData){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/delete?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:选择卡券 - 解析CODE *******************************************************/ public function wxCardDecryptCode($jsonData){ $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/code/decrypt?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:更改库存 *******************************************************/ public function wxCardModifyStock($cardId , $increase_stock_value = 0 , $reduce_stock_value = 0){ if(intval($increase_stock_value) == 0 && intval($reduce_stock_value) == 0){ return false; } $jsOnData= json_encode(array("card_id" => $cardId , &#39;increase_stock_value&#39; => intval($increase_stock_value) , &#39;reduce_stock_value&#39; => intval($reduce_stock_value))); $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/modifystock?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } /******************************************************* * 微信卡券:查询用户CODE *******************************************************/ public function wxCardQueryCode($code , $cardId = &#39;&#39;){ $jsOnData= json_encode(array("code" => $code , &#39;card_id&#39; => $cardId )); $wxAccessToken = $this->wxAccessToken(); $url = "https://api.weixin.qq.com/card/code/get?access_token=" . $wxAccessToken; $result = $this->wxHttpsRequest($url,$jsonData); $jsOninfo= json_decode($result, true); return $jsoninfo; } }

推荐阅读
  • 本文介绍了前端人员必须知道的三个问题,即前端都做哪些事、前端都需要哪些技术,以及前端的发展阶段。初级阶段包括HTML、CSS、JavaScript和jQuery的基础知识。进阶阶段涵盖了面向对象编程、响应式设计、Ajax、HTML5等新兴技术。高级阶段包括架构基础、模块化开发、预编译和前沿规范等内容。此外,还介绍了一些后端服务,如Node.js。 ... [详细]
  • 本文介绍了如何使用jQuery和AJAX来实现动态更新两个div的方法。通过调用PHP文件并返回JSON字符串,可以将不同的文本分别插入到两个div中,从而实现页面的动态更新。 ... [详细]
  • Java验证码——kaptcha的使用配置及样式
    本文介绍了如何使用kaptcha库来实现Java验证码的配置和样式设置,包括pom.xml的依赖配置和web.xml中servlet的配置。 ... [详细]
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了如何使用JSONObiect和Gson相关方法实现json数据与kotlin对象的相互转换。首先解释了JSON的概念和数据格式,然后详细介绍了相关API,包括JSONObject和Gson的使用方法。接着讲解了如何将json格式的字符串转换为kotlin对象或List,以及如何将kotlin对象转换为json字符串。最后提到了使用Map封装json对象的特殊情况。文章还对JSON和XML进行了比较,指出了JSON的优势和缺点。 ... [详细]
  • 本文内容为asp.net微信公众平台开发的目录汇总,包括数据库设计、多层架构框架搭建和入口实现、微信消息封装及反射赋值、关注事件、用户记录、回复文本消息、图文消息、服务搭建(接入)、自定义菜单等。同时提供了示例代码和相关的后台管理功能。内容涵盖了多个方面,适合综合运用。 ... [详细]
  • VScode格式化文档换行或不换行的设置方法
    本文介绍了在VScode中设置格式化文档换行或不换行的方法,包括使用插件和修改settings.json文件的内容。详细步骤为:找到settings.json文件,将其中的代码替换为指定的代码。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • CSS3选择器的使用方法详解,提高Web开发效率和精准度
    本文详细介绍了CSS3新增的选择器方法,包括属性选择器的使用。通过CSS3选择器,可以提高Web开发的效率和精准度,使得查找元素更加方便和快捷。同时,本文还对属性选择器的各种用法进行了详细解释,并给出了相应的代码示例。通过学习本文,读者可以更好地掌握CSS3选择器的使用方法,提升自己的Web开发能力。 ... [详细]
  • Windows下配置PHP5.6的方法及注意事项
    本文介绍了在Windows系统下配置PHP5.6的步骤及注意事项,包括下载PHP5.6、解压并配置IIS、添加模块映射、测试等。同时提供了一些常见问题的解决方法,如下载缺失的msvcr110.dll文件等。通过本文的指导,读者可以轻松地在Windows系统下配置PHP5.6,并解决一些常见的配置问题。 ... [详细]
  • flowable工作流 流程变量_信也科技工作流平台的技术实践
    1背景随着公司业务发展及内部业务流程诉求的增长,目前信息化系统不能够很好满足期望,主要体现如下:目前OA流程引擎无法满足企业特定业务流程需求,且移动端体 ... [详细]
  • 使用正则表达式爬取36Kr网站首页新闻的操作步骤和代码示例
    本文介绍了使用正则表达式来爬取36Kr网站首页所有新闻的操作步骤和代码示例。通过访问网站、查找关键词、编写代码等步骤,可以获取到网站首页的新闻数据。代码示例使用Python编写,并使用正则表达式来提取所需的数据。详细的操作步骤和代码示例可以参考本文内容。 ... [详细]
  • 例如控件ID为user.id使用$(#user.id)不能得到正确的结果必须使用\\转义即$(#user\\.id)转载于:https:www.cnblogs.comrch ... [详细]
  • 在Android中解析Gson解析json数据是很方便快捷的,可以直接将json数据解析成java对象或者集合。使用Gson解析json成对象时,默认将json里对应字段的值解析到java对象里对应字段的属性里面。然而,当我们自己定义的java对象里的属性名与json里的字段名不一样时,我们可以使用@SerializedName注解来将对象里的属性跟json里字段对应值匹配起来。本文介绍了使用@SerializedName注解解析json数据的方法,并给出了具体的使用示例。 ... [详细]
  • Android实战——jsoup实现网络爬虫,糗事百科项目的起步
    本文介绍了Android实战中使用jsoup实现网络爬虫的方法,以糗事百科项目为例。对于初学者来说,数据源的缺乏是做项目的最大烦恼之一。本文讲述了如何使用网络爬虫获取数据,并以糗事百科作为练手项目。同时,提到了使用jsoup需要结合前端基础知识,以及如果学过JS的话可以更轻松地使用该框架。 ... [详细]
author-avatar
Laiio120669
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有