-
浅谈PHP中new self()和new static()的区别
[PHP教程] 2021-02-22 04:01:19 180人阅读
本文介绍了PHP中new self()和new static()的区别,分享给大家,也给自己留个笔记。 1.new static()是在PHP5.3版本中引入的新特性。 2.无论是new static()还是new self(),都是new了一个新的对象。 3.这两个方法new出...[详细]
-
php readfile()修改文件上传大小设置
[PHP教程] 2021-02-22 03:46:57 176人阅读
使用PHP ZipArchive生成的压缩包,小的压缩包都能下载,今天遇到个150M以上的就报404错误,第一想到的就是文件大小超出了PHP默认设置,修改方法有两个: php.ini:memory_limit memory_limit是设置内存限制的,如果...[详细]
-
PHP验证码无法显示的原因及解决办法
[PHP教程] 2021-02-22 03:45:35 105人阅读
PHP验证码无法显示的原因及解决办法 一、如果是utf-8,就有可能是BOM没有清除 二、在Header("Content-type: image/PNG"); 之前有输出 三、第一行PHP隐藏了代码,如空格,回车等。 解决代码: 以上就是PHP验证码无法...[详细]
-
PHP实现的自定义图像居中裁剪函数示例【测试可
[PHP教程] 2021-02-22 03:44:36 86人阅读
本篇章节讲解PHP实现的自定义图像居中裁剪函数。供大家参考研究具体如下: 图像居中裁减的大致思路: 1.首先将图像进行缩放,使得缩放后的图像能够恰好覆盖裁减区域。(imagecopyresampled — 重采样拷贝部分图像并...[详细]
-
关于PHP中协程和阻塞的一些理解与思考
[PHP教程] 2021-02-22 03:43:08 183人阅读
前言 本文主要给大家介绍了关于PHP中协程和阻塞的理解与思考,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍: 进程、线程、协程 关于进程、线程、协程,有非常详细和丰富的博客或者学习资源,我不...[详细]
-
PHP递归实现文件夹的复制、删除、查看大小操作
[PHP教程] 2021-02-22 03:32:21 72人阅读
本篇章节讲解PHP递归实现文件夹的复制、删除、查看大小操作。供大家参考研究具体如下: PHP虽然提供了 filesize、copy、unlink 等文件操作的函数,但是没有提供 dirsize、copydir、rmdirs 等文件夹操作的函数(rmdir...[详细]
-
PHP基于迭代实现文件夹复制、删除、查看大小等
[PHP教程] 2021-02-21 10:24:19 134人阅读
本篇章节讲解PHP基于迭代实现文件夹复制、删除、查看大小等操作的方法。供大家参考研究具体如下: 前面一篇 分析了递归操作使用技巧,这里再来分析一下迭代的操作技巧。 “既然递归能很好的解决,为什么还要用迭代呢...[详细]
-
PHP基于MySQLI函数封装的数据库连接工具类【定
[PHP教程] 2021-02-21 10:23:41 64人阅读
本篇章节讲解PHP基于MySQLI函数封装的数据库连接工具类。供大家参考研究具体如下: mysql.class.php: mysqli = new mysqli($host,$username,$password,$database,$port); } /** * 数据查询 * @param $table 数据表 ...[详细]
-
PHP新特性之字节码缓存和内置服务器
[PHP教程] 2021-02-21 10:22:42 87人阅读
Zend OPcache 1).从PHP5.0开始,内置了字节码缓存功能,名为Zend OPcache。因为PHP是解释性语言,PHP解释器执行PHP脚本时会解析PHP脚本代码,生成一系列的Zend操作码,然后执行字节码,每次的HTTP请求都是这样,会消...[详细]
-
php数据序列化测试实例详解
[PHP教程] 2021-02-21 10:21:54 163人阅读
php数据序列化测试实例详解 测试代码 23];$start = microtime(true); for($i=0;$i $start = microtime(true); for($i=0;$i100000;$i++){ $packMsg = serialize($msg); } echo 'php len:'.strlen($packMsg)."\r\n"; $...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]