-
详细解说PHP中breakcontinuereturnexit的区别
[PHP教程] 2022-07-18 11:58:20 176人阅读
详细解说PHP中break、continue、return、exit的区别 1、 return 语句的作用 (1) return 从当前的方法中退出,返回到该调用的方法的语句处,继续执行。 (2) return 返回一个值给调用该方法的语句,返回值的数据类型必须...[详细]
-
php保留两位小数的几种方法介绍
[PHP教程] 2022-07-18 11:57:44 66人阅读
php保留两位小数的几种方法介绍 1.不进位的情况 比如3.149569取小数点后两位,最后两位不能四舍五入。结果:3.14。 可以使用 floor 函数 该函数是舍去取整。例如,floor(4.66456) 结果:4 。 floor(9.1254) 结果9 。...[详细]
-
PHP如何使用mpdf将html页面转换pdf文件?
[PHP教程] 2022-07-18 11:57:19 193人阅读
本文主要需求是将html页面转换为pdf文档 1、安装mpdf工具类 (composer方式) composer require mpdf/mpdf:8.0.3 2、控制器里调用 ?php public function test_pdf(){ //$mpdf = new \Mpdf\Mpdf(); $mpdf = new \Mpdf...[详细]
-
PHP如何解压缩zip文件?代码示例
[PHP教程] 2022-07-18 11:56:44 158人阅读
PHP解压缩zip文件 1、使用PHP执行文件解压缩zip文件,前提条件,一定要确定服务器开启了zip拓展 2、封装的方法如下: 实例代码: ?php /** * 压缩文件 * @param array $files 待压缩文件 array(d:/test/1.txt,d:/te...[详细]
-
php如何解析url?解析url的5种方式介绍
[PHP教程] 2022-07-18 11:56:09 194人阅读
php解析url的几种方式 1、利用$_SERVER内置数组变量 访问:http://localhost/test.php?m=adminc=indexa=listscatid=1page=1 //URL的参数 echo $_SERVER[QUERY_STRING]; 返回: m=adminc=indexa=listscatid=1page=1 /...[详细]
-
了解PHP中json_encode与json_decode的区别
[PHP教程] 2022-07-18 11:55:44 110人阅读
json_encode() 对变量进行JSON编码 语法:json_encode($value[,$options=0]) 注意: 1、$value为要编码的值,且该函数只对UTF8编码的数据有效; 2、options:由以下常量组成的二进制掩码:JSON_HEX_QUOT, JSON_HEX_TA...[详细]
-
实现详解Ajax+php数据交互并且局部刷新页面
[PHP教程] 2022-07-18 11:54:51 152人阅读
什么是Ajax? 国内翻译常为阿贾克斯和阿贾克斯足球队同音,AJAX 是一种用于创建快速动态网页的技术,他不是新语言,而是一种使用现有标准的新方法。通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更...[详细]
-
直击php中unserialize返回false的解决方法
[PHP教程] 2022-07-18 11:54:06 151人阅读
本文实例讲述了php中unserialize返回false的解决方法,分享给大家供大家参考。具体方法如下: php 提供serialize(序列化) 与unserialize(反序列化)方法。 使用serialize序列化后,再使用unserialize反序列化就可以获...[详细]
-
如何通过file_get_contents发送GETPOST请求?方
[PHP教程] 2022-07-18 11:50:06 91人阅读
服务器端执行HTTP请求,大家经常使用的就是CURL,curl工具的确是很好的数据文件传输工具,那么除此之外还有其他的工具能实现这个功能吗? 现在为你介绍一个很常见的工具 file_get_content() 纳尼,这不是PHP文件操作...[详细]
-
详解php-fpm中max_children的配置
[PHP教程] 2022-07-18 11:49:46 61人阅读
现在nginx + fpm 基本成为主流的配置,其中我们比较关注的是pm.max_chindren的配置 首先,我们关注一个设置: pm = static/dynamic, 这个选项是标识fpm子进程的产生模式: static :表示在fpm运行时直接fork出pm.ma...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]