Home>Article>Backend Development> Explanation of how to obtain the WeChat shared delivery address in PHP
This article mainly introduces in detail the method of obtaining the WeChat shared delivery address in PHP. It has certain reference value. Interested friends can refer to it.
The example in this article shares PHP with everyone. Get the specific code of the WeChat shared delivery address for your reference. The specific content is as follows
It must be the WeChat authorized directory. I put it directly in the root directory and other directories are invalid
/* * 在执行此操作之前 首先判断您是否开通了 微信支付功能 审核通过后均可使用一下代码 * 1、设置微信公众平台网页授权 域名 www.abc.com * 2、设置下面的 “ 微信参数 ” * 3、把 当前文件 index.php 放入根目录 * 4、用微信访问http://www.abc.com/index.php 就可以了 切记一定是微信哦 * */ 30, CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, ); /* 根据请求类型设置特定参数 */ $opts[CURLOPT_URL] = $url ; $ch = curl_init(); curl_setopt_array($ch, $opts); $data = curl_exec($ch); $error = curl_error($ch); curl_close($ch); return $data; } function p($star){ echo ''; print_r($star); echo ''; } function logtext($content){ $fp=fopen("json.ini","a"); fwrite($fp,"\r\n".$content); fclose($fp); } //创建签名SHA1 function genSha1Sign($Parameters){ $signPars = ''; ksort($Parameters); foreach($Parameters as $k => $v) { if("" != $v && "sign" != $k) { if($signPars == '') $signPars .= $k . "=" . $v; else $signPars .= "&". $k . "=" . $v; } } //$signPars = http_build_query($Parameters); $sign = SHA1($signPars); $Parameters['sign'] = $sign; return $sign; } ?>获取共享地址 The above is the entire content of this article. I hope it will be helpful to everyone’s study. I also hope that everyone will support the php Chinese website.
Articles you may be interested in:
Detailed steps to deploy thinkphp5 project on cloud virtual host
##PHPCrawl crawler library implements an example explanation of the method of crawling Kugou playlists
An example explanation of the method of generating blurry images in PHP
The above is the detailed content of Explanation of how to obtain the WeChat shared delivery address in PHP. For more information, please follow other related articles on the PHP Chinese website!