首页
📷在线壁纸
🎬娱乐天地
🔖友情链接
更多
📝留言板
Search
1
【javascript】JS-向当前url追加参数
2,345 阅读
2
【PHP】生成随机昵称
2,219 阅读
3
【PHP】判断一个字符串是否属于序列化后的数据
2,026 阅读
4
【css】html+css给文章页,做阅读全文
1,975 阅读
5
【PHP】 设计模式(23种)
1,913 阅读
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
stableDiffusion
TTS
yolo
3D
code
comfyui
ASR
登录
Search
标签搜索
php
typecho
代码注释
redis
mysql
go
golang
nginx
thinkphp
docker
gin
linux
curl
html
mamp
算法
短网址
构造函数
webhook
代码片段
依然范儿特西
累计撰写
150
篇文章
累计收到
1
条评论
首页
栏目
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇 mysql
🍈 Winform
🍓 golang
🍉 设计模式
🥝 PHP
🍎 python
🍊 nginx
🍋 网络安全
🍍 javascript
🫑 database
🍭文艺范
🍏mac
AI
LLM
stableDiffusion
TTS
yolo
3D
code
comfyui
ASR
页面
📷在线壁纸
🎬娱乐天地
🔖友情链接
📝留言板
搜索到
150
篇与
的结果
2023-02-15
redis如何提高缓存命中率
redis如何提高缓存命中率
2023年02月15日
49 阅读
0 评论
0 点赞
2023-02-06
无法启动 Parallels Desktop,因为您的 Mac 操作系统缺少一些必需组件
无法启动 Parallels Desktop,因为您的 Mac 操作系统缺少一些必需组件
2023年02月06日
301 阅读
0 评论
2 点赞
2022-12-15
PHP解析小程序返回的buffer信息,并解析成图片
需要引入 GuzzleHttp 包composer require guzzlehttp/guzzle核心代码如下:<?php require __DIR__ . './vendor/autoload.php'; use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; /** * get client * @return Client */ function httpGetClient() { static $client ; if (!$client) { $client = new Client(); } return $client; } //GET function httpGet($url) { $client = httpGetClient(); $options = [ 'verify' => false, ]; $response = $client->get($url,$options); return $response->getBody()->getContents(); } // POSTBODY function httpPostBody($url, $requestData=[], $header=[]) { $client = httpGetClient(); $options = [ 'headers' => $header, 'body' => json_encode($requestData,JSON_UNESCAPED_UNICODE ), 'verify' => false, ]; $response = $client->post($url, $options); if ($response->getStatusCode()==200) { return $response->getBody()->getContents(); }else{ return null; } } //postForm function httpPostForm($url, $requestData, $header) { $client = new Client(['verify' => false]); try { $response = $client->request('post', $url, ['form_params' => $requestData, 'headers' => $header]); $response->getStatusCode(); // 200 $response->getHeaderLine('content-type'); if ($response->getStatusCode()==200) { return [true,$response->getBody()->getContents()]; }else{ return [false,[]]; } } catch (GuzzleException $e) { } return [false,[]]; } function getAccessToken(){ $appid = ''; $secret = ''; //获取access_token $access_token_url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appid.'&secret='.$secret; $access_token_data = httpGet($access_token_url); $access_token_data = json_decode($access_token_data,true); return $access_token_data['access_token']; } function getQrcode($access_token){ $url = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token='.$access_token; $requestData = [ 'path'=>'pages/order-status/index?loose_id=1', 'width'=>430, ]; $header = []; return httpPostBody($url,$requestData,$header); } $access_token = getAccessToken(); //$access_token = ""; $data = getQrcode($access_token); if(is_null(json_decode($data))){ //不是json数据, 有数据流,返回值为null $jpg = $data; //创建文件写入 $file = fopen("img/test.jpg",'w'); fwrite($file,$jpg); fclose($file); }else{ //不是数据流,则代表有错误发生 $data_array = json_decode($data,true); print_r($data_array); } ?> 如果提示你无法写入, 记得新建一个文件夹: img ,并给可写权限
2022年12月15日
30 阅读
0 评论
1 点赞
2022-12-06
window下 phpstudy+nginx报错502的处理办法
1 开启日志修改nginx 日志级别, 开启错误日志和访问日志2 端口检测查看 80 端口和 9000 端口占用情况, 大部分是因为 9000端口被占用导致# 查看所有的端口 netstat -ano # 查询指定的端口占用,在命令行输入: netstat -aon | findstr 端口号 # 查询PID对应的进行进程: tasklist | findstr PID #关闭程序: taskkill /f /t /im 程序名
2022年12月06日
60 阅读
0 评论
1 点赞
2022-12-01
网站置灰样式代码
代码<style> html{filter: grayscale(1);} </style>
2022年12月01日
34 阅读
0 评论
0 点赞
2022-12-01
thinkphp3.2 AuthBehavior.class中,使用session无效原因分析
背景在开发中。 创建了一个 AuthBehavior.class 在做全局的权限验证, 里边会读取session, admin_id, 结果是读取失败原因在AuthBehavior.class这个类中,使用session的时候,session_start()还没有执行,所以无法读取;过程分析:关于 behavior 文件加载,程序执行过程大概是这样index.php -> 应用开始(app_begin)标签位侦听并执行绑定行为 -> session启动 -> 控制器开始(action_begin)标签位侦听并执行绑定行为解决办法第一种: 修改tags.php文件'app_begin' => array('Behavior\AuthBehavior'), 修改为 'action_begin' => array('Behavior\AuthBehavior'), 第二种: 偏方:在index.php就启用session_start(); 但是这样有一个问题,就是配置文件里面的那些改变session配置的参数可能及不起作用了(例如session前缀 SESSION_PREFIX) 提示:session函数位置 ThinkPHP\Common\functions.php参考文章:https://www.kancloud.cn/manual/thinkphp/1704
2022年12月01日
33 阅读
0 评论
1 点赞
2022-11-30
解决thinkphp5 session失效问题
1 index.php//定义session 保存目录 define('SESSION_SAVE_PATH',__DIR__.'./runtime/session/');2 config.php增加session的保存目录 path // +---------------------------------------------------------------------- // | 会话设置 // +---------------------------------------------------------------------- 'session' => [ 'id' => '', // SESSION_ID的提交变量,解决flash上传跨域 'var_session_id' => '', // SESSION 前缀 'prefix' => 'laofan_', // 是否自动开启 SESSION 'auto_start' => true, //有效期 'expire' => 86400, // 驱动方式 'type' => '', 'path'=>SESSION_SAVE_PATH, ],
2022年11月30日
52 阅读
0 评论
0 点赞
2022-11-28
golang字符串切割
//定义一个字符串和相应map str := "PHP 是 世 界 上 最 好 的 编 程 语 言" map1 := make(map[string]int) //进行切割,此处成为[]string,并进行排序,方便后面直接计数 str2 := strings.Split(str, " ") sort.Strings(str2) for i := 0; i < len(str2); i++ { count := 1 for j := i + 1; j < len(str2); j++ { if str2[j] == str2[i] { count++ i = j } } map1[str2[i]] = count } fmt.Println(map1)
2022年11月28日
34 阅读
0 评论
0 点赞
2022-11-17
新冠三年十月下,豫州府 记实
新冠三年十月下豫州府 记实豫州府城外,南六十余里,盘踞一工场,台籍商贾所建,使人三十万众,多以弱冠少年,妙龄少女求生于台商,场内大疫突生,众染疾者无药者有之,无食更有之,真相不明,流言四起,故万人皆仓惶流窜,不顾险境,希冀求生。众万人弃物逃之,监工衙役力阻。然距家短则几十里,远则三五百里之遥,以步为尺,或行田间,或行官道,风餐夜宿,弃性命于不顾。沿途百姓观之,均侧身落泪,于道侧放裹腹之物,助众返。时日,城内禁足有月,庶民怨气冲天,轻生者有一二,商贩破产者更众,城外众逃。民怨达至庙堂,派巡按御史、太史令至豫州府查明缘由。州府黄土铺街,所经之处,迁人乔装,吩咐万勿错答,以对应付。庶民群起而怒骂之,州府闭其眼,堵其耳,闭其口,无睹言其他。是以功过,待后人评!
2022年11月17日
76 阅读
0 评论
2 点赞
2022-11-10
V50js代码
疯狂星期四, v50let arr = [ [1, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22], [2, 8, 12, 18, 22], [3, 7, 12, 13, 14, 15, 16, 18, 22], [4, 6, 16, 18, 22], [5, 5, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22], ]; function demo(arr) { let str = ""; let style=[]; for (let i = 0; i < arr.length; i++) { for (j = 0; j < 30; j++) { if (arr[i].indexOf(j) > -1) { str += "%c█"; style.push(j< 12 ? "color:red" : "color:green") } else { str += " "; } } str += "\n"; } return [str,...style]; } console.log(...demo(arr));
2022年11月10日
70 阅读
0 评论
0 点赞
1
...
3
4
5
...
15