php安装redis (mac)
mac安装redis安装redis brew install redis配置文件路径/usr/local/etc/redis.conf启动redis redis-server添加至开机启动项1、ln -f /usr/local/Cellar/redis/6.2.6/homebrew.mxcl.redis.plist ...
thinkphp6整合jwt
composer安装jwt包创建密钥php think jwt:create使用方式:对于需要验证的路由或者模块添加中间件:thans\jwt\middleware\JWTAuth::class,示例:$token = JWTAuth::builder(['uid' => 1]);//...
http response status code http响应状态码
public static function get_http_status($code) { $code = intval($code); $headers_desc = [ 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 200 => 'O...
js进入页面自动加载的几种方式
直接写到html标签里<html> <body onload='load();'> </body> </html>js中调用<script type='text/javascript'> function myfun() { alert('this window.onload')...
查看服务器端口是否放行
netstat 命令来查看端口是否开放(tcp类型端口)//查看是否监听在0.0.0.0:1025 netstat -aptn |grep -i 1025 //查看TCP类型的端口 netstat -lptn |grep -i 1025 //查看UDP类型的端口 netstat -l...
字符串内容的替换PHP
使用新的字符串替换原来字符串中指定的特定字符串str_replace 区分大小写str_ireplace() 不区分大小写str_replace(find,replace,string,count) str_ireplace(find,replace,string,count)参数...
laravel多语言设置
根据自己使用的laravel版本,composer安装对应的包 config/app.php中配置默认语言'locale' => 'zh_CN',将语言文件放置在resources/lang目录中(例:resources/lang/zh_CN/demo.php)<?ph...
curl模拟GET、POST、PUT、DELETE请求(PHP)
<?php namespace App\Helpers\Tool; use App\Helpers\Traits\SingletonTrait; use Illuminate\Support\Facades\Log; class Curl { use SingletonTrait; protected $app_token; public functi...
PHP常用助手函数
隐藏手机号中间4位替换成*if (!function_exists('hide_mobile')) { function hide_mobile(string $mobile) { return substr_replace($mobile, '****', 3, 4); } }判断是否是手机号if (!function...