-
详解PHP swoole process的使用方法
[PHP教程] 2021-03-07 05:52:14 89人阅读
引入背景:假如我们每天有10000个订单生成,需要同步到仓储系统中去,以前做法是开启一个crontab去跑这些任务,但是发现总有感觉同步效率低,间隔时间都是分钟级别的。 解决方案测试:我们将同步订单的任务表添加一...[详细]
-
PHP观察者模式原理与简单实现方法示例
[PHP教程] 2021-03-07 05:52:14 103人阅读
本篇章节讲解PHP观察者模式原理与简单实现方法。供大家参考研究具体如下: 当一个对象状态发生改变后,会影响到其他几个对象的改变,这时候可以用观察者模式。像wordpress这样的应用程序中,它容外部开发组开发插件...[详细]
-
php实现简单的权限管理的示例代码
[PHP教程] 2021-03-07 05:52:14 145人阅读
今天主要来实现一个权限管理系统,它主要是为了给不同的用户设定不同的权限,从而实现不同权限的用户登录之后使用的功能不一样,首先先看下数据库 总共有5张表,qx_user,qx_rules和qx_juese 3张表与另外2张表形成"w"...[详细]
-
PHP实现的各类hash算法长度及性能测试实例
[PHP教程] 2021-03-06 21:58:14 108人阅读
本篇章节讲解PHP实现的各类hash算法长度及性能测试。分享给大家供大家参考,具体如下: Hash结果如下 运行结果: 性能测试如下: 运行结果: 1.4528379546356 [fnv164] => 1.4598390410767 [fnv1a64] => 1.468549896...[详细]
-
PHP实现的简单sha1加密功能示例
[PHP教程] 2021-03-06 21:46:19 108人阅读
本篇章节讲解PHP实现的sha1加密功能。供大家参考研究具体如下: 运行结果: PS:关于加密解密感兴趣的朋友还可以参考本站在线工具: 文字在线加密解密工具(包含AES、DES、RC4等): 在线MD5/hash/SHA-1/SHA-2/SHA-2...[详细]
-
yii2中LinkPager增加总页数和总记录数的实例
[PHP教程] 2021-03-06 21:46:14 152人阅读
本文介绍了php中LinkPager增加总页数和总记录数,分享给大家,也给自己留个笔记 项目路径 vendor\yiisoft\yii2\widgets\LinkPager.php renderPageButtons方法中增加 $buttons[] = Html::tag('li',Html::tag("span",'...[详细]
-
PHP实现的简单对称加密与解密方法实例小结
[PHP教程] 2021-03-06 21:46:14 95人阅读
本篇章节讲解PHP实现的简单对称加密与解密方法。分享给大家供大家参考,具体如下: 方法一:YII自带的加密方法 getSecurity()->encryptByPassword($data,$secretKey); get('uid');$secretKey = "wwj";$uid = Yii::$a...[详细]
-
PHP实现超简单的SSL加密解密、验证及签名的方法
[PHP教程] 2021-03-06 21:46:14 163人阅读
本篇章节讲解PHP实现超简单的SSL加密解密、验证及签名的方法。供大家参考研究具体如下: 1. sign签名代码: 2. verify 验证代码: 3. 解密代码 PS:关于加密解密感兴趣的朋友还可以参考本站在线工具: 文字在线加密...[详细]
-
基于PHP的加载类操作以及其他两种魔术方法的应
[PHP教程] 2021-03-06 21:46:14 96人阅读
实例如下所示: 加载类 //include("./Ren.class.php"); //include "./Ren.class.php"; include_once("./Ren.class.php"); include_once("./Ren.class.php"); $f = new Ren(); $f-test(); require("./Ren.class.php")...[详细]
-
PHP大文件分割上传 PHP分片上传
[PHP教程] 2021-03-06 21:46:14 92人阅读
服务端为什么不能直接传大文件?跟php.ini里面的几个配置有关 当然不能简单粗暴的把上面几个值调大,否则服务器内存资源吃光是迟早的问题。 解决思路 好在HTML5开放了新的FILE API,也可以直接操作二进制对象,我们...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]