-
PHP测试结构PHPUnit基本使用
[PHP教程] 2022-06-24 13:51:12 84人阅读
PHP测试框架PHPUnit基本使用 一、前言 在这篇文章中,我们使用 composer 的依赖包管理工具进行phpunit包安装和管理,composer 官方地址 https://getcomposer.org/,按照提示进行全局安装即可,另外,我们也会使用一...[详细]
-
php扩展安装不生效问题怎么处理?
[PHP教程] 2022-06-24 13:50:29 51人阅读
php扩展安装不生效问题怎么解决?下面本篇文章给大家介绍一下解决php扩展安装不生效问题,有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。 php安装扩展模块后,重启不生效的原因及解决办法 在lnm...[详细]
-
php增删改查封装方法
[PHP教程] 2022-06-24 13:48:58 118人阅读
php增删改查封装 首先创建一个名为DB的类;然后在DB类的构造方法中去连接数据库;再根据连接实例进行编写增删改查操作;最后将DB类进行实例化并设置为全局变量即可。 封装代码: ?php /** * 数据库配置信息 */ defin...[详细]
-
有关PHP http 报文设置 CURLOPT_HTTPHEADER
[PHP教程] 2022-06-24 13:47:41 56人阅读
PHP CURLOPT_HTTPHEADER 设置的坑 废话不多说直接上代码 //省略。。。 我们的 $headers 一般会这么写 //省略。。。 curl_setopt($ci, CURLOPT_HTTPHEADER, $headers); //正确写法 $headers = [ Content-Type:applica...[详细]
-
PHP 中的生成器Generator细解
[PHP教程] 2022-06-24 13:46:29 161人阅读
谈到驾驶,速度并非一切。但在网络上,速度变得与众不同。你的应用程序越快,用户体验越好。这篇文章是关于 PHP 生成器的,那么我们为什么要讨论速度呢?你很快就会发现,生成器在速度和内存的管理上发挥着巨大的作...[详细]
-
PHP如何让中文转英文
[PHP教程] 2022-06-24 13:23:01 137人阅读
PHP如何将中文转英文 1、使用第三方翻译接口API,如百度翻译,Google翻译,有道翻译等,只需在PHP代码中进行调用; 下面是使用有道翻译的示例: ?php function transLate($word){ // keyfrom和apikey是有道开放平台...[详细]
-
PHP融合AJAX实现搜索提示功能
[PHP教程] 2022-06-24 13:22:19 129人阅读
PHP结合AJAX实现搜索提示功能 首先将创建一个输入框;然后监听输入框的keyup事件,当事件触发时,使用AJAX请求将输入的内容发送给PHP;接着PHP根据输入的内容进行数据查找并返回;最后将返回的数据进行渲染即可。 示...[详细]
-
CGI,FastCGI,PHP-CGI,PHP-FPM 简单掌握
[PHP教程] 2022-06-24 13:21:19 179人阅读
CGI,FastCGI,PHP-CGI,PHP-FPM 简单了解 1、php-fpm 解决了什么问题? php-CGI 的平滑重启。 php-CGI 的常驻管理。(这里的常驻是指在 php-CGI 进程被杀死后 php 就挂了,php-fpm 会在 php 进程被杀死后重新启动 p...[详细]
-
正式开源的优雅测试结构 PestPHP
[PHP教程] 2022-06-24 13:20:52 67人阅读
控制台的传奇人物 Nuno Maduro 已经将 Pest 开源了,这是一个注重简单性的优雅 PHP 测试框架。 下面有一个简单的例子,如果你使用过其他测试工具,比如 Mocha 或者 Jest,你就会对它觉得熟悉: test(asserts true is...[详细]
-
PHP中如何生成静态页面
[PHP教程] 2022-06-24 13:20:12 102人阅读
什么是PHP静态化 PHP静态化的简单理解就是使网站生成页面以静态HTML的形式展现在访客面前,PHP静态化分纯静态化和伪静态化,两者的区别在于PHP生成静态页面的处理机制不同。 PHP生成静态HTML页面的方法 1、使用PHP文...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]