-
php curl请求接口并获取数据的示例代码
[PHP教程] 2021-03-07 06:17:15 159人阅读
当我们在做PHP开发的时候,很多时候需要对接口进行测试,或者更方便的调用一些已有模块的接口,取到结果并进行后续操作,我们可以通过curl进行模拟提交post和get请求,来去实现这些功能。 下面是对curl的post和get的...[详细]
-
php面向对象(一) 初窥(php面向对象基础介绍)
[PHP教程] 2021-03-07 06:17:15 131人阅读
初窥php面向对象 1.类:类就是属性和方法的集合 是一个抽象的概念比如生活中的“人”,"汽车"2.对象:对象是具体的事物 比如一叫“小强”的人 一辆叫“奥迪a7”的汽车3.类和对象的关系:类是抽象的出来的某种事物的集合...[详细]
-
Yii2框架之ListView小部件的使用方法
[PHP教程] 2021-03-07 06:17:15 160人阅读
ListView是yii框架中类似GridView,也是用于展示多条数据的小部件,相比GridView,ListView可以更加灵活地设置数据展示的格式。 下面以我自己做的一个使用ListView来展示数据的例子,来简单讲解一下ListView小部件的...[详细]
-
PHP5.6新增加的可变函数参数用法分析
[PHP教程] 2021-03-07 05:52:14 91人阅读
本篇章节讲解PHP5.6新增加的可变函数参数用法。供大家参考研究具体如下: 今天无事,看了下PHP手册。发现PHP版本更新增加不少东西。下面就说说其中的PHP5.6更新中新增加的可变函数参数。 代码1: 代码1结果: 代码1...[详细]
-
PHP实现的策略模式简单示例
[PHP教程] 2021-03-07 05:52:14 61人阅读
本篇章节讲解PHP实现的策略模式。供大家参考研究具体如下: 比如说购物车系统,在给商品计算总价的时候,普通会员肯定是商品单价乘以数量,但是对中级会员提供8者折扣,对高级会员提供7折折扣,这种场景就可以使用策...[详细]
-
Yii2框架可逆加密简单实现方法
[PHP教程] 2021-03-07 05:52:14 90人阅读
本篇章节讲解YII2框架可逆加密简单实现方法。分享给大家供大家参考,具体如下: 加密: getSecurity()->encryptByPassword($data,$secretKey); 解密: getSecurity()->decryptByPassword($encryptedData,$secretKey)...[详细]
-
php变量与JS变量实现不通过跳转直接交互的方法
[PHP教程] 2021-03-07 05:52:14 155人阅读
本篇章节讲解php变量与JS变量实现不通过跳转直接交互的方法。供大家参考研究具体如下: 大家都知道如果JS变量要获取后台传来的php变量可以这么写: var aaa = ; 那么我们如何将js变量的值直接付给php变量呢 第一种方...[详细]
-
Yii2.0小部件GridView(两表联查/搜索/分页)功能
[PHP教程] 2021-03-07 05:52:14 167人阅读
GridView 两表联查/搜索/分页 当我们在一个网格视图中显示活动数据的时候,你可能会遇到这种情况,就是显示关联表的列的值,为了使关联列能够排序,你需要连接关系表,以及添加排序规则到数据提供者的排序组件中,对...[详细]
-
详解PHP swoole process的使用方法
[PHP教程] 2021-03-07 05:52:14 89人阅读
引入背景:假如我们每天有10000个订单生成,需要同步到仓储系统中去,以前做法是开启一个crontab去跑这些任务,但是发现总有感觉同步效率低,间隔时间都是分钟级别的。 解决方案测试:我们将同步订单的任务表添加一...[详细]
-
PHP观察者模式原理与简单实现方法示例
[PHP教程] 2021-03-07 05:52:14 103人阅读
本篇章节讲解PHP观察者模式原理与简单实现方法。供大家参考研究具体如下: 当一个对象状态发生改变后,会影响到其他几个对象的改变,这时候可以用观察者模式。像wordpress这样的应用程序中,它容外部开发组开发插件...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]