1 Star 0 Fork 0

梦中程序员 / 助手函数

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

封装一些经常用的函数

  1. check_captcha($phone, $code, $msg) 校验验证码是否正确,万能验证码888888
参数 含义
phone 手机号
code 验证码
msg 错误提示信息,默认是验证码不正确
  1. format_time($time, $type) 格式化时间
参数 含义
time 需要格式化的时间
type 1是Y-m-d H:i:s;2是Y-m-d H:i;3是Y-m-d;4是聊天时间
  1. generate_nickname() 生成昵称
  2. handle_get_pic($pics, $type) 生成可直接访问的地址
参数 含义
$pics 图片,多张使用逗号分隔
type 1是单张需要默认;2是多张;3是单张不需要默认;4多张中取一张有默认
  1. handle_set_pic($pics, $type = 1) 生成不带域名的地址
参数 含义
$pics 图片,多张使用逗号分隔
type 1是单张;2是多张
  1. handle_set_content($content) 生成不带域名的富文本
参数 含义
content 富文本内容
  1. handle_get_content($content = null) 生成带域名的富文本
参数 含义
content 富文本内容
  1. handle_get_num($num = null) 生成带w的数字
参数 含义
num 数字
  1. generate_room_num($fromId, $toId) 生成聊天房间号
参数 含义
fromID 发送者ID
toID 接受者ID
  1. result($data = null, $code, $msg = '操作成功', $url = null)
MIT License Copyright (c) 2021 Leruge Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

thinkphp6下使用的助手函数 展开 收起
PHP
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/leruge/tp-helper.git
git@gitee.com:leruge/tp-helper.git
leruge
tp-helper
助手函数
master

搜索帮助