-
php实现socket推送技术的示例
[PHP教程] 2021-03-30 08:02:04 50人阅读
在socket出现之前已经有ajax定时请求、长轮询等方案,但都不能满足需求,socket就应用而生了。 socket基本函数 总结下常用的socket函数 服务端: socket_create 创建socket设置基本参数 socket_bind 绑定ip和端口号 ...[详细]
-
PHP实现生成模糊图片的方法示例
[PHP教程] 2021-03-30 08:02:04 156人阅读
本篇章节讲解PHP实现生成模糊图片的方法。分享给大家供大家参考,具体如下: image_create_from_ext($srcImg); $srcImgObj=$this->blur($gdImageResource,$blurFactor); $temp = pathinfo($srcImg); $name = $temp['...[详细]
-
yii框架redis结合php实现秒杀效果(实例代码)
[PHP教程] 2021-03-16 23:57:00 163人阅读
废话不多说了,直接给大家贴代码了,具体代码如下所示: db->createCommand("select * from goods ")->queryAll();return $this->render('index',['data'=>$data]);}Public function actionXx(){$id=yii::$app->requ...[详细]
-
PHP 中魔术常量的实例详解
[PHP教程] 2021-03-16 23:57:00 140人阅读
PHP 中魔术常量的实例详解 本文介绍下,php编程中的魔术常量,掌握并灵活应用这些方法与常量,对于提高php的编程水平,有很大的帮助。有需要的朋友参考学习下。 魔术常量: 运行结果 如有疑问请留言或者到本站社区交...[详细]
-
php静态成员方法和静态的成员属性的使用方法
[PHP教程] 2021-03-16 23:57:00 177人阅读
php静态成员方法和静态的成员属性的使用方法 静态成员方法和静态的成员属性 如下使用: //在类的内部调用静态的成员方法的时候,也要使用self或者类名关键字,推荐在类的内部使用self wan::yukuai(); self::yukuai() ...[详细]
-
PHP中类型转换 ,常量,系统常量,魔术常量的详解
[PHP教程] 2021-03-16 23:57:00 137人阅读
PHP中类型转换,常量,系统常量,魔术常量的详解 1.自动类型转换; '5'; 3)实数直接转换为对应的字符串,但尾0不转(实数小数点最后的0); 4)true转换为'1‘,false转为空串;字符串、布尔、整型、浮点、null3) 运算时发生...[详细]
-
PHP对象的浅复制与深复制的实例详解
[PHP教程] 2021-03-16 23:57:00 99人阅读
PHP对象的浅复制与深复制的实例详解 最近在看原型模式时注意到这个问题~~PHP中对象 '=' 与‘clone...[详细]
-
利用php获得flv视频长度的实例代码
[PHP教程] 2021-03-16 23:57:00 147人阅读
废话不多说了,直接给大家贴代码了,具体代码如下所示: BigEndian2Int(fread($fp,4)); $flv_header_frame_length = 9; if ($frame_size_data_length > $flv_header_frame_length) { fseek($fp,$frame_size_data_len...[详细]
-
详解php 使用Callable Closure强制指定回调类型
[PHP教程] 2021-03-16 23:46:02 188人阅读
详解php 使用Callable Closure强制指定回调类型 如果一个方法需要接受一个回调方法作为参数,我们可以这样写 function callback(){ echo 'do sth callback'; } testCallBack('callback'); ? 但我们不能确定回调方法...[详细]
-
PHP实现网站访问量计数器
[PHP教程] 2021-03-16 23:46:02 183人阅读
简单的网站访问量计数器实现,具体如下 首先说明 思路 : 1.用户向服务器发出访问请求2.服务器读取访问次数文件,+1,向客户端返回3.服务器保存新的浏览次数4.新用户访问,重复123即可 解决方案 (主要算法): 1.数...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]