05 2020 档案

摘要:php搭建项目管理系统mantisbt 1、下载下载地址: https://www.mantisbt.org/download.php2、解压缩后上传个人比较喜欢FileZilla(看过他家的bug工具BugZilla的安装,知难而退了)。服务器我用的万网虚拟主机和阿里云RDS数据库,所以文件上传到 阅读全文
posted @ 2020-05-23 15:42 MargoHu 阅读(2423) 评论(0) 推荐(0)
摘要:php生成二维码 <?php /** * 生成二维码 * @param string $url 二维码的内容 * @param string $logo 二维码中间的LOGO * @param string $save_dir 保存路径 * @return bool|string */ functi 阅读全文
posted @ 2020-05-21 17:30 MargoHu 阅读(226) 评论(0) 推荐(0)
摘要:php生成九宫格图片 <?php /** * 生成群组九宫格头像 * param $pic_list array 群主和前八个群成员的头像(图片地址的数组) * param $group_id int 群组id,用于生成头像名字 */ function set_img($pic_list, $gro 阅读全文
posted @ 2020-05-21 17:25 MargoHu 阅读(798) 评论(0) 推荐(1)
摘要:PHP实现时间格式转换,获取友好的时间显示 1.函数gmstrftime(); <?php /** * 时间友好显示 * @param int $time 时间戳 * @return string 友好时间字符串 * @author zhouzy */ function get_friendly_t 阅读全文
posted @ 2020-05-21 17:18 MargoHu 阅读(360) 评论(0) 推荐(0)
摘要:<?php /** * 精确加法 * @param [type] $a [description] * @param [type] $b [description] */ function math_add($a,$b,$scale = '2') { return bcadd($a,$b,$scal 阅读全文
posted @ 2020-05-15 00:02 MargoHu 阅读(4194) 评论(0) 推荐(0)
摘要:PHP查看在主机禁用的函数 <?php header("content-Type: text/html; charset=utf-8"); header("Cache-Control: no-cache, must-revalidate"); header("Pragma: no-cache"); 阅读全文
posted @ 2020-05-13 00:20 MargoHu 阅读(701) 评论(0) 推荐(0)
摘要:php计算持续时长 <?php /** * 计算持续时长 * * @param int $second 秒数 * @return string $duration 5天10小时43分钟40秒 */ function secondTime($seconds=0){ $duration = ''; $s 阅读全文
posted @ 2020-05-12 16:14 MargoHu 阅读(1015) 评论(0) 推荐(0)
摘要:PHP获取毫秒时间戳 <?php /** * 返回当前的毫秒时间戳 * @return string */ function msectime() { list($tmp1, $tmp2) = explode(' ', microtime()); return sprintf('%.0f', (fl 阅读全文
posted @ 2020-05-12 00:18 MargoHu 阅读(372) 评论(0) 推荐(0)
摘要:php扩展 swoole的安装与使用 https://blog.csdn.net/nuli888/article/details/51849699 https://www.jianshu.com/p/462013f18177 swoole 安装用的是centOSphp安装目录:/usr/local/ 阅读全文
posted @ 2020-05-10 23:40 MargoHu 阅读(428) 评论(0) 推荐(0)
摘要:<?php public function task() { $list = M('SysTask')->where(['status' => ['neq',3]])->select(); // 通过文件锁住操作执行完再执行下一个 $fp = fopen("lock.txt", "w+"); if 阅读全文
posted @ 2020-05-10 23:38 MargoHu 阅读(209) 评论(0) 推荐(0)
摘要:1.先确保redis进程存活ps -ef|grep redis 12.执行./redis-cli或者./redis-cli -h 127.0.0.1 -p 6379[root@slave bin]# /bin/redis-cli 13.执行dbsize命令127.0.0.1:6379> dbsize 阅读全文
posted @ 2020-05-10 00:34 MargoHu 阅读(10445) 评论(0) 推荐(0)
摘要:NGINX设置http强制跳转https 方法一: 打开nginx.conf或虚拟机配置文件 server { listen 80; server_name dev.wangshibo.com; index index.html index.php index.htm; access_log /us 阅读全文
posted @ 2020-05-09 16:06 MargoHu 阅读(1642) 评论(0) 推荐(0)
摘要:PHP随机生成内容 <?php /** * 随机生成账号 * @param string $initial 首字母 S:商店 C:平台 * @param string $no 编号 * @return string */ function random_login_name($initial, $n 阅读全文
posted @ 2020-05-08 22:55 MargoHu 阅读(280) 评论(0) 推荐(0)
摘要:PHP获取浏览器,PHP获取IP地址,PHP获取设备型号 <?php //获取浏览器 function get_broswer(){ $sys = $_SERVER['HTTP_USER_AGENT']; //获取用户代理字符串 $exp[0] = "未知浏览器"; $exp[1] = ""; // 阅读全文
posted @ 2020-05-08 22:53 MargoHu 阅读(1461) 评论(0) 推荐(0)
摘要:PHP常见的加密方式 <?php /** * 对数据根据字符串进行asc加密 * @param array curlData 加密数组 * @param string rands 加密字符串 * @return string date 加密后的字符串 * @author lyx 2019-06-19 阅读全文
posted @ 2020-05-08 22:49 MargoHu 阅读(897) 评论(0) 推荐(0)
摘要:PHP拆分金额 <?php function get_money($money,$number,$cash){ $list = array(); for ($i=0; $i < $number - 1; $i++) { $list[] = sprintf("%.2f",$money / 2 * (r 阅读全文
posted @ 2020-05-08 22:34 MargoHu 阅读(440) 评论(0) 推荐(0)
摘要:PHP常用的方法 <?php /** * 对数据根据字符串进行asc加密 * @param array curlData 加密数组 * @param string rands 加密字符串 * @return string date 加密后的字符串 * @author lyx 2019-06-19 * 阅读全文
posted @ 2020-05-08 22:32 MargoHu 阅读(249) 评论(0) 推荐(0)
摘要:PHP对银行卡做掩码处理 <?php /* */ // * 对银行卡号进行掩码处理 // * @param string $bankCardNo 银行卡号 //* @return string 掩码后的银行卡号 /* */ function formatBankCardNo($bankCardNo) 阅读全文
posted @ 2020-05-08 22:11 MargoHu 阅读(282) 评论(0) 推荐(0)
摘要:PHP错误处理之将错误日志保存在系统文件中 <?php ini_set('display_errors',0); ini_set('log_errors',1); ini_set('error_log','sys_log'); echo $test;//输出一个未定义的变量 echo '<hr/>' 阅读全文
posted @ 2020-05-08 08:22 MargoHu 阅读(406) 评论(0) 推荐(0)
摘要:PHP错误处理方法之将错误日志以邮件方式发送 1.设置php.ini 2.使用 <?php error_reporting(-1); ini_set('display_error',0); ini_set('log_errors',1); error_log('当前系统被人攻击啦,产生致命错误!!! 阅读全文
posted @ 2020-05-08 00:02 MargoHu 阅读(308) 评论(0) 推荐(0)
摘要:PHP配置文件与错误日志相关信息 处理登录的代码dologin.php <?php //可将此方法记录分析尝试攻击网站的来源 header('content-type:text/html;charset=utf-8 '); ini_set('display_errors',0);//不显示PHP错误 阅读全文
posted @ 2020-05-07 23:55 MargoHu 阅读(328) 评论(0) 推荐(0)
摘要:PHP错误级别处理,隐藏错误信息 PHP错误级别: 1.最低级别错误 Deprecated <?php //例 if(ereg('china','this is china',$matches)){ print_r($matches); }else{ echo 'not find'; } 2.通知级 阅读全文
posted @ 2020-05-07 23:13 MargoHu 阅读(1168) 评论(0) 推荐(0)