- 博客(10)
- 收藏
- 关注
原创 php微信支付
服务端控制器代码class PaymentController { private $common = null; public function __construct() { $this->common = new Common(); } private function message($message, $error = '1') { $this->co...
2019-10-22 10:17:57
163
原创 curl请求
curl请求url为请求的地址params为ppst请求的数据,若为空则是get public function makeRequest($url, $params = array(), $expire = 0, $extend = array(), $hostIp = '') { if (empty($url)) { return array('code' =&...
2019-10-22 10:08:10
118
原创 php跳出循环continue,break,exit
continue:跳出当前的循环(一重)public function x() { for ($i=0; $i < 5; $i++) { dump($i); continue; dump($i); }}输出结果:<pre>int(0) </pre> <pre>int(1) </pre&
2018-12-08 10:59:52
564
原创 TP验证码
public function code() { $config = array( 'codeSet' => '0123456789', 'fontSize' => 50, 'length' => 5, //'useCurve' => false, 'useNoise' => false, ); $verify = new \Think\Ve...
2018-11-27 11:10:11
314
原创 TP利用水印进行图片合成
public function shopCode($store_user_id,$user_id,$data_send,$savepath,$status,$class_id) { $img_path = ROOT . 'style/kong.png'; $user_shop_model = new \Common\Model\UserShopModel(); $shop_...
2018-11-27 10:31:59
480
原创 php更换二维码中间的图片
protected function codeImg($logo ,$QR ,$pathimg) {//$logo要更换的图片路径,$QR二维码图片路径,$pathimg完成后图片存储路径 $dir = $QR; $QR = imagecreatefromstring(file_get_contents($QR)); $logo = imagecreatefromstring(f...
2018-11-27 10:30:22
681
原创 修改图片为圆形
function createRoundImg($imgpath,$circle_path) {//$imgpath原图片路径,$circle_path完成后图片存储路径 $ext = pathinfo($imgpath); $src_img = null; switch ($ext['extension']) { case 'jpg': ...
2018-11-27 10:28:22
459
原创 php获取小程序二维码
public function getWxcode($store_me, $user_me, $url,$status=1,$type=1){ $ACCESS_TOKEN = $this->getWxAccessToken(); $url_token = "https://api.weixin.qq.com/wxa/getwxacode?access_token="....
2018-11-27 10:26:15
268
原创 php 小程序发送模板消息
public function senMsg(){ $ACCESS_TOKEN = $this->getWxAccessToken(); $url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=".$ACCESS_TOKEN['access_token']; ...
2018-11-27 10:21:50
217
原创 从一个数组中抽取不同的元素
public function j() { $user = array(1,1,2,1,1,1,1,1,9); $draw_user = []; $num = 3; for ($i=0; $i < $num; $i++) { $user_key = array_rand($user,1); $draw_user[] = $user[$user_key]; $chec...
2018-11-27 10:17:04
688
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人