- 博客(65)
- 问答 (2)
- 收藏
- 关注
原创 configure: error: Please install libyaml pcre2.h: No such file or directory
echo $(brew --prefix libyaml) | pecl install yaml
2024-12-17 09:42:03
105
转载 new branch unable to update local ref
步骤一、清除松散对象 git gc --prune=now步骤二、刷新本地分支 git remote prune origin步骤三、拉取远端仓库代码 git pull
2024-08-27 15:38:18
95
原创 Elasticsearch使用scroll_id游标 解决10000条数据限制
PHP Elasticsearch使用scroll_id游标 解决10000条数据限制。
2022-11-18 11:12:02
1310
转载 docker php Call to undefined function imagettftext ()
docker php Call to undefined function imagettftext ()
2022-07-26 16:38:46
884
原创 Elasticsearch 字段录入中文之后,wildcard模糊查询只能单个字搜索,多个字搜索没有结果
Elasticsearch 字段录入中文之后,wildcard模糊查询只能单个字搜索,多个字搜索没有结果
2022-07-14 11:55:52
1865
原创 Redis 两个list 用新的list替换老的list 以及command keys must in same slot解决办法
redis list 'RENAME' command keys must in same slot
2022-06-20 15:50:02
1032
原创 curl json数据并获取返回响应头header信息
private static function curlJson($url, $data_string, $header = array() ) { $header[] = 'Expect:'; $header[] = 'X-AjaxPro-Method:ShowList'; $header[] = 'Accept: application/json,*/*'; $header[] = 'Content-Type: applicatio
2021-07-23 09:17:00
1165
转载 AES 密钥 各种长度
function keygen($length) { $token = ''; $tokenlength = round($length * 4 / 3); for ($i = 0; $i < $tokenlength; ++$i) { $token .= chr(rand(32, 1024)); } $token = base64_encode(str_shuffle($token)); return substr($token, 0.
2021-07-07 14:43:31
2516
原创 laravel-admin 登录页面无限重定向 1.8.10
config/admin.php'auth'=>[...'excepts'=>[ 'auth/login',]],然后就正常了
2020-12-23 14:20:43
1295
2
原创 php7.2给每个数组元素加上前缀 create_function换成匿名函数
$imglist = explode('|',$detail['imgList']);$arr = array_map(function($item){return "https://img1.360buyimg.com/n1/$item";}, $imglist);
2020-11-20 16:13:33
323
转载 Laravel中使用路由控制权限 思路
https://blog.youkuaiyun.com/pharaoh_shi/article/details/79711473
2020-10-20 14:53:33
598
原创 PHP 压缩图片尺寸 png做透明处理
//修改图片尺寸 png做透明处理//$imgsrc 要处理图片路径文件 $imgdst 生成图片路径文件 $new_width新的宽度 $new_height新的高度 public function compressedImg($imgsrc, $imgdst, $new_width, $new_height) { list($width, $height, $type) = getimagesize($imgsrc); switch ($type).
2020-09-01 11:21:25
496
转载 laravel Call to undefined method 1Illuminate\Database\Query\Builder::getForeignKeyName() or 1Illumin
vendor/laravel/framework/src/Illuminate/Database/Eloquent/Relations/BelongsTo.php 添加!!!!!!!public function getForeignKeyName(){ $segments = explode('.', $this->getQualifiedForeignKeyName()); return end($segments);}public function getQual.
2020-07-31 15:44:21
898
原创 MAC 安装PHP7.2 启动php-fpm NOTICE: fpm is running, pid 13487 NOTICE: ready to handle connections
php-fpm配置文件daemonize = no 修改为daemonize = yessudo php-fpmOK!
2020-07-30 15:52:30
4193
原创 PHP 取中文字之间的数字 (满4元减1元)
主要是判断淘宝的满减$str = "满4元减1元";$po1= (strpos($str,"满"));$po2= (strpos($str,"元减"));echo '取值:'.substr($str,$po1+3,$po2-3);取值:4
2020-06-11 14:47:43
180
原创 支付宝 APP支付
创建充值:public function createRechargeOrder(){ $mobile = $this->request->post('mobile')?$this->request->post('mobile'):0; $amount = $this->request->post('amount')?$this->request->post('amount'):0;//充值金额 $ty.
2020-05-09 10:34:07
625
原创 解决svn working copy locked问题
1.svn服务器运行svn cleanup2.提交改动 这时候会提示是什么问题 我的问题是 post-commit hook failed (exit code 1) with output: Conflict discovered in '........../pdd.php';3.svn服务器运行svn cleanup4.把文件回退到 没有修改的状态5.提交,现在就...
2020-04-24 10:28:32
229
原创 openssl_public_encrypt(): key parameter is not a valid public key
public key 不管一行还是 64个字符分行都会报这个错误。找了一下用这种方法成功了$public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ...";$public_key = "-----BEGIN PUBLIC KEY-----\n" . wordwrap($public_key, 64, "\n", true) . "\n---...
2020-04-14 14:13:05
6275
1
转载 php 生成6位随机字符串
/** * 生成随机字母加数字 字符串 * @param int $len 要生成字符串长度 * @param null $chars 要生成字符串包含的字符 * @return string 生成的字符串 */ public function getRandomString($len = 6, $chars = null) ...
2020-04-06 11:02:54
2378
原创 JSON 字符串和对象对比
$str = '{"extraMap":"{\"app\":\"activitylist.html\"}"}';var_dump(json_decode($str));$str1 = '{"extraMap":{"app":"activitylist.html"}}';var_dump(json_decode($str1));object(stdClass)#1 (1) { ["...
2020-03-23 18:26:03
329
原创 中文年月日 日期转成时间戳
$time = '2020年01月01日 00:00:00';public function dateToTime($format='Y年m月d日 H:i:s', $time){ $dt = date_create_from_format ( $format, $time); $data['start'] = date_timestamp_get($dt);//当天开始时间...
2020-01-07 10:47:04
2014
原创 Tp5 调用阿里云OSSsdk
<?php//阿里云oss存储namespace app\common\controller;vendor('aliyun-oss.autoload');use OSS\OssClient;use OSS\Core\OssException;class AliyunOss{ public $accessKeyId = ""; public $accessKeySecre...
2019-12-05 15:27:30
1203
原创 tp5 分页查询同时循环操作数据
Db::name('orders') ->where($map) ->order('create_time desc') ->paginate(50) ->each(function($item, $key){ //循环操作 return $item; });
2019-11-20 10:09:19
703
原创 苏宁佣金链接获取商品ID
$str = 'https://sugs.suning.com/C6cTlAxy';$content = file_get_contents($str);preg_match('/id="ga_itemDataBean_itemID" value="(\d*)"/', $content, $matches);var_dump($matches);$preg="/[^0]+.*/is";...
2019-11-06 10:22:26
1140
转载 PHP 含秘钥的可逆加密解密算法
// 加密算法function encrypt($data, $key){ $key = md5($key); $x = 0; $len = strlen($data); $l = strlen($key); $char = ''; $str = ''; for ($i = 0; $i < $len; $i++) { ...
2019-10-21 09:22:33
1715
原创 tp5 读数据库的时候把时间戳格式字段改为日期格式
$result = Db::name("articles") ->alias('A') ->join('article_cate B', 'A.cate = B.id') ->where(["user_id"=>$this->user_id,"active"=>1]) ...
2019-05-21 17:13:46
3977
原创 淘宝客商品 获取详情图片
https://open.21ds.cn/index/index/openapi/id/73.shtml?ptype=1 我现在用的是他家的接口下面的接口不能用了 $.ajax({url:"https://hws.m.taobao.com/cache/desc/5.0?id="+id,//淘宝商品IDtimeout:1000,tryC...
2019-02-25 11:33:48
7391
4
原创 Mac下tp5 nginx 配置
server { listen 8080; server_name www.tp5api.mm; access_log /usr/local/var/www/logs/access.log; error_log /usr/local/var/www/logs/error.log; index ind...
2019-01-06 11:15:37
1234
转载 PHP对redis操作详解【转】
/*1.Connection*/$redis = new Redis();$redis->connect('127.0.0.1',6379,1);//短链接,本地host,端口为6379,超过1秒放弃链接$redis->open('127.0.0.1',6379,1);//短链接(同上)$redis->pconnect('127.0.0.1',6379,1);//长链接,...
2018-12-12 16:42:14
205
原创 php 分割中文字符串(1个字,多个字)
/** * 分割中文字符串 * $str 字符串 * $count 个数 */ public function mb_str_split($str, $count){ $leng = strlen($str)/3; //中文长度 $arr = array(); for ($i=...
2018-11-27 13:08:06
7263
1
原创 php 下载远程图片到本地(图片)
/** * @param $image 文件(数据库存储形式为2018/2018174760.jpg) * @param $imgName 重命名 */ public function downImg($image,$imgName) { $url = "http://xxx.com/Uploads/"; $file...
2018-11-27 13:06:43
815
原创 Vue学习之路(2)vue-router
vue-router 是vue很重要的组成部分。1.一般用vue脚手架新建v项目时会选择安装vue-router,没有的话 在项目 目录下执行 sudo cnpm install vue-router 安装2.在src目录下有router文件夹 有index.js import Vue from 'vue'import Router from 'vue-router...
2018-09-17 23:16:04
188
空空如也
同一个base64字符串PHP和JAVA decode结果不一样 求对应的PHP代码
2021-07-22
PHP对接银行JAVA 私钥解密出现乱码
2021-07-21
TA创建的收藏夹 TA关注的收藏夹
TA关注的人