-
PHP利用Cookie设置用户30分钟未操作自动退出功
[PHP教程] 2021-02-04 21:09:12 114人阅读
登陆控制器需要做的登陆成功把用户ID等信息存入cookie: systemSetKey(array(‘name‘=>$admin_info[‘admin_name‘],‘id‘=>$admin_info[‘admin_id‘],‘gid‘=>$admin_info[‘admin_gid‘],‘sp‘=>$admin_info[...[详细]
-
PHP错误处理函数register_shutdown_function使
[PHP教程] 2021-02-04 21:05:42 182人阅读
当程序在线上运行时,如果遇到BUG,想不在前端输出错误信息,同时能及时邮件通知开发者,register_shutdown_function函数就可以派上用场了。 注册一个会在脚本执行完成或者 exit() 后被调用的函数。 可以多次调用 re...[详细]
-
PHP使用preg_split和explode分割textarea存放内
[PHP教程] 2021-02-04 21:00:34 96人阅读
本篇章节讲解PHP使用preg_split和explode分割textarea存放内容的方法。供大家参考研究具体如下: 今天有个紧急的bug,说是后台在配置了白名单后,在手机端app无效,仍然显示内容。收到邮件后,便走了遍流程,发现后...[详细]
-
PHP简单获取上月、本月、近15天、近30天的方法
[PHP教程] 2021-02-04 20:56:19 115人阅读
本篇章节讲解PHP简单获取上月、本月、近15天、近30天方法。供大家参考研究具体如下: date('Ym01',strtotime('-1 month')),'lastday...[详细]
-
phpcms配置列表页以及获得文章发布时间
[PHP教程] 2021-02-04 20:52:44 129人阅读
废话不多说了,直接给大家贴代码了,具体代码如下所示: {loop $data $key $val} {php list($copyfrom) = explode('|',$val['copyfrom'])} {$val['title']} {/loop} {/pc} 调用一级栏目名称跟二级栏目名称: 以上所...[详细]
-
一个非常实用的php文件上传类
[PHP教程] 2021-02-04 20:49:41 63人阅读
其实网上已经有很多这样的类了,不过出于练手的目的还是自己仿照着写了一个。 下面的代码放在一个名为UploadFile.class.php文件内 /** * 构造函数,初始化 * @param string $rand_name 是否随机命名 * @param string...[详细]
-
php基于数组函数实现关联表的编辑操作示例
[PHP教程] 2021-02-04 07:07:37 194人阅读
本篇章节讲解php基于数组函数实现关联表的编辑操作。供大家参考研究具体如下: 需求为,在创建学校时,需要添加应用,于是创建了个学校应用关联表,编辑学校并提交时,后台需要判断更新的应用是否为一开始提交的,或...[详细]
-
PHP基于方差和标准差计算学生成绩的稳定性示例
[PHP教程] 2021-02-04 07:03:06 182人阅读
本篇章节讲解PHP基于方差和标准差计算学生成绩的稳定性。供大家参考研究具体如下: 项目中的学生端有处个人成长档案模块,要求依据学生近期十次考试成绩通过波动采集分析学生的成绩稳定性。学过数学都知道,这处应该...[详细]
-
PHP处理bmp格式图片的方法分析
[PHP教程] 2021-02-04 07:02:36 102人阅读
本文分析了PHP处理bmp格式图片的方法。供大家参考研究具体如下: 白天QA提出项目上传图片有问题,具体为:上传成功,预览失败。我去了之后,又上传了几张其他的图片可以上传,然后仔细问了下他上传的是哪张图片,看...[详细]
-
详解PHP使用Redis存储session时的一个Warning定
[PHP教程] 2021-02-04 07:01:57 59人阅读
1. 问题现象 系统页面刷新的时候,偶尔会报错下面的Warnning,但是不经常出现: Warning: Unknown: Failed to write session data (Redis). Please verify that the current setting of session.save_path is correct...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]