![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
小何擅长写bug
这个作者很懒,什么都没留下…
展开
-
fastAdmin后台一键生成后台菜单
框架文档:https://doc.fastadmin.net/doc/crud.html如果嫌麻烦不想看文档,可以看已下内容(我比较笨,虽然很简单,但需要记录下)一:生成菜单1.第一步首先在数据库中创建一个你想建立的数据表(比如:fa_test),编辑好表字段结构,并且一定写上字段注释和表注释2.简易的生成一个菜单php think crud -t 你所要生成的模块名称命令执行后出现这行命令就代表生成成功Build Successed3.生成成功后需要刷新下后台所有菜原创 2021-08-10 11:55:10 · 1505 阅读 · 0 评论 -
使用php函数将二维数组转换为一维数组
array_column($arr,'phone');$arr填写为你要转换的二维数组,‘phone’为你要转换的下标原创 2021-02-19 10:51:28 · 177 阅读 · 0 评论 -
获取当前页面完整的url(带参数)
'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);原创 2020-12-31 10:33:22 · 342 阅读 · 0 评论 -
tp5注册
//用户信息入库(注册) public function toRegister(Request $request = null) { if (Request::instance()->isPost()){ $userInfo = $request->post(); $smsCode = $this->redis->get('ZJ_'.$userInfo['mobile'].date('Y-m-d'...原创 2020-12-30 16:14:49 · 229 阅读 · 0 评论 -
PHP 封装图形验证码(本人使用tp5框架)
1.封装好的图形验证码(挪用注意修改命名空间)<?phpnamespace app\city\controller;use think\Controller;use think\Cookie;use think\Session;class Verify extends Controller{ public function getImgCode(){ ob_clean(); Cookie::set('graphicCode',NULL);原创 2020-12-15 18:04:27 · 207 阅读 · 0 评论 -
git远程创建新分支
1.先查看所有分支git branch -a2.创建本地分支git checkout -b 分支名称3.推送到远程git push --set-upstream origin 分支名称原创 2020-11-17 13:47:03 · 118 阅读 · 0 评论 -
laravel 存储redis
需引用:use Illuminate\Support\Facades\Redis;根据键值获取相对应redis的值Redis::get($key);存储redisRedis::setex(键值, 储存时间, 所存储的值);实例: public function getHotNewsList($table, $join_table, $day = 3) { //redis键值,根据变量进行分层储存 $key = \App\Enum\Redi原创 2020-11-04 14:02:10 · 439 阅读 · 0 评论 -
post接收数组出现variable type error: array报错信息
post接收数组时出现需在接收数组时参数名称后加上/a $id = $request->param("arr_id/a");原创 2020-10-14 10:00:29 · 456 阅读 · 0 评论 -
获取layui多选框选中的ID
HTMl<div class="layui-btn-group demoTable"> <button class="layui-btn" data-type="getCheckData">获取选中的ID</button></div>JSgetCheckData: function(){ //获取选中数据 var checkStatus = table.checkStatus('testReload') ,data原创 2020-09-23 10:50:06 · 1331 阅读 · 0 评论 -
根据当前时间戳获取所需要的的时间戳
1.获取当前时间戳$day = mktime(0,0,0); 或 $day = strtotime("today");2.获取一星期前的初始时间戳$last_week = strtotime("-7 day",$day);(在当前时间的基础上)同理一天前便是 $last_day = strtotime("-1 day",$day);原创 2020-07-16 11:47:54 · 614 阅读 · 0 评论