-
Yii输入正确验证码却验证失败的解决方法
[PHP教程] 2021-01-21 15:45:39 87人阅读
前言 最近在做一个需求时,发现输入正确验证码,但是都提示验证码错误 最后追踪代码发现,如果 Model 在 save 前,单独做了 validate 验证,则在验证结束后,会重新生成验证码 然后在我们 Model save 时,也会进行 v...[详细]
-
php利用ffmpeg提取视频中音频与视频画面的方法
[PHP教程] 2021-01-21 15:43:38 148人阅读
前言 FFmpeg的名称来自MPEG视频编码标准,前面的“FF”代表“Fast Forward”,FFmpeg是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。可以轻易地实现多种视频格式之间的相互转换。 FFmp...[详细]
-
PHP实现删除多重数组对象属性并重新赋值的方法
[PHP教程] 2021-01-21 15:42:40 132人阅读
本篇章节讲解PHP实现删除多重数组对象属性并重新赋值的方法。供大家参考研究具体如下: 实例:sphinx搜索出来的结果,要去掉某个属性值: Query ( $keyword,$index ); 方法一,直接删除属性: $val ) { unset($query...[详细]
-
iis6手工创建网站后无法运行php脚本的解决方法
[PHP教程] 2021-01-21 15:40:04 57人阅读
给人搬了十几个网站,老站用西部数码建站助手创建的,现在过期了无法继续创建,只能在Internet 信息服务(IIS)管理器创建网站,创建下来都没问题,但是就是无法打开网站。 测试打开txt文档、静态页面都能打开,一到打...[详细]
-
PHP简单获取随机数的常用方法小结
[PHP教程] 2021-01-19 01:51:26 184人阅读
本篇章节讲解PHP简单获取随机数的常用方法。供大家参考研究具体如下: 1.直接获取从min-max的数,例如1-20: 2.在一个数组里面随机选择一个(验证码的时候需要字母、数字混合的情况) PS:这里再为大家提供两款功能...[详细]
-
PHP获取redis里不存在的6位随机数应用示例【设
[PHP教程] 2021-01-19 01:45:57 74人阅读
本篇章节讲解PHP获取redis里不存在的6位随机数的方法。供大家参考研究具体如下: PHP获取6位数随机数 PHP str_shuffle() 函数 用php的str_shuffle函数: 实例:获取redis里面不存在的6位随机数(设置24小时过时) ge...[详细]
-
php简单构造json多维数组的方法示例
[PHP教程] 2021-01-19 01:45:01 171人阅读
本篇章节讲解php简单构造json多维数组的方法。供大家参考研究具体如下: php构造json多维数组其实很简单 下面列举了将mysqli的查询结果数组序列化为json的php代码如下 fetch()){ $fileinfo['fileid'] = $fileid; $fi...[详细]
-
php显示页码分页类的封装
[PHP教程] 2021-01-19 01:44:08 176人阅读
本文实例为大家分享了php封装显示页码的分页类,供大家参考,具体内容如下 一、代码 conn.php connect(); } public function connect(){ $conn=mysql_pconnect('localhost','root','root') or die("Connect MySQL Fa...[详细]
-
PHP 7.0新增加的特性介绍
[PHP教程] 2021-01-19 01:42:52 54人阅读
?? 运算符(NULL 合并运算符) 把这个放在第一个说是因为我觉得它很有用。用法: $a = $_GET['a'] ?? 1;它相当于: ?? 运算符(NULL 合并运算符) 把这个放在第一个说是因为我觉得它很有用。用法: $a = $_GET['a'] ...[详细]
-
PHP使用PHPExcel实现批量上传到数据库的方法
[PHP教程] 2021-01-19 01:39:11 177人阅读
此例子只使用execel2003的.xls文档,若使用的是其他版本,可以保存格式为“Execel 97-2003 工作簿(*.xls)”即.xls文件类型即可! 功能说明:只能上传Excel2003类型的xls文件,大小不超过5M。可下载例子模板添加数据后...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]