-
Yii框架分页实现方法详解
[PHP教程] 2021-01-17 21:21:14 176人阅读
本篇章节讲解Yii框架分页实现方法。供大家参考研究具体如下: 下家公司用的框架是yii,这几天看了下相关教程,今儿把分页教程写下,最后把tp的分页也给整合进了yii,因为个人觉得yii分页没有tp用的顺手。 首页,在mo...[详细]
-
yii2项目实战之restful api授权验证详解
[PHP教程] 2021-01-17 21:19:53 76人阅读
前言 什么是restful风格的api呢?我们之前有写过来介绍其概念以及基本操作。 既然写过了,那今天是要说点什么吗? 这篇文章主要针对实际场景中api的部署来写。 我们今天就来大大的侃侃那些年api遇到的授权验证问题!...[详细]
-
Yii框架参数化查询中IN查询只能查询一个的解决
[PHP教程] 2021-01-17 21:17:59 176人阅读
本篇章节讲解Yii框架参数化查询中IN查询只能查询一个的解决方法。分享给大家供大家参考,具体如下: 在yii框架中使用参数化进行IN查询时,结果不如所愿 createCommand($sql)->query([':ids' => '1013,1015,1017'])->...[详细]
-
Yii框架使用魔术方法实现跨文件调用功能示例
[PHP教程] 2021-01-17 21:17:32 85人阅读
本篇章节讲解Yii框架使用魔术方法实现跨文件调用。供大家参考研究具体如下: 目前项目用yii框架,controller调用facade的方法,facade调用adapter的方法,adapter调用api的方法,api封装了sql方法,但是大部分情况下...[详细]
-
Yii框架实现的验证码、登录及退出功能示例
[PHP教程] 2021-01-17 14:14:31 191人阅读
本篇章节讲解Yii框架实现的验证码、登录及退出功能。供大家参考研究具体如下: 捣鼓了一下午,总算走通了,下面贴出代码。 Model 注:我的用户表是auth,所以模型是Auth.php !CCaptcha::checkRequirements(),'messag...[详细]
-
php readfile下载大文件失败的解决方法
[PHP教程] 2021-01-17 14:13:57 141人阅读
本篇章节讲解php readfile下载大文件失败的解决方法。供大家参考研究具体如下: 大文件有200多M,只下载了200K就提示下载完成,且不报错。 原因是PHP内存有限制,需要改为按块下载,就是 把大文件切块后逐块下载 。 ...[详细]
-
老生常谈PHP 文件写入和读取(必看篇)
[PHP教程] 2021-01-17 14:01:51 112人阅读
文章提纲: 一.实现文件读取和写入的基本思路 二.使用fopen方法打开文件 三.文件读取和文件写入操作 四.使用fclose方法关闭文件 五.文件指针的移动 六.Windows和UNIX下的回车和换行 一.实现文件读取和写入的...[详细]
-
PHP中trait使用方法详细介绍
[PHP教程] 2021-01-17 14:00:57 121人阅读
说通俗点,PHP中使用trait关键字是为了解决一个类既想集成基类的属性和方法,又想拥有别的基类的方法,而trait一般情况下是和use搭配使用的。 carName}\n"; } } class Person { public function eat() { echo "eat\n...[详细]
-
php写app接口并返回json数据的实例(分享)
[PHP教程] 2021-01-17 13:58:32 185人阅读
第一步:conn. PHP 文件,用于连接 数据库 并定义接口格式,代码如下: $code,'message...[详细]
-
PHP实现json_decode不转义中文的方法
[PHP教程] 2021-01-17 13:57:10 110人阅读
本篇章节讲解PHP实现json_decode不转义中文的方法。供大家参考研究具体如下: 默认情况下PHP的 json_decode 方法会把特殊字符进行转义,还会把中文转为 Unicode 编码形式。 这使得数据库查看文本变得很麻烦。所以我...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]