-
PHP实现找出有序数组中绝对值最小的数算法分析
[PHP教程] 2021-02-22 17:37:15 156人阅读
本篇章节讲解PHP实现找出有序数组中绝对值最小的数算法。供大家参考研究具体如下: 问题: 一个有序数组,值有可能有负值,也有可能没有,现需要找出其中绝对值最小的值。 方法1: 遍历数组,找到绝对值最小值,时间...[详细]
-
PHP 文件锁与进程锁的使用示例
[PHP教程] 2021-02-22 17:36:40 150人阅读
鉴于前面介绍了swoole,就借用swoole的服务器/客户端与多进程机制对锁进行说明. 这里只针对PHP的锁机制进行说明,由于SQL的锁与其作用方式和应用场景不同,将作另行说明. 1.文件锁 flock() fclose() swoole_lock() 文件...[详细]
-
Eclipse PHPEclipse 配置的具体步骤
[PHP教程] 2021-02-22 17:36:08 63人阅读
最近偶来兴致趁着有些时间,看了看php的书。 说到php就不得不提php的开发环境了,一般的都是采用apache做服务器、mysql做数据库,再加上php组合成一个完备的运行环境,但是好像没有写代码的编译器啊,一直用notepad...[详细]
-
PHP编程实现阳历转换为阴历的方法实例
[PHP教程] 2021-02-22 17:35:19 134人阅读
本篇章节讲解PHP编程实现阳历转换为阴历的方法。分享给大家供大家参考,具体如下: php类 lunarInfo[$year-$this->MIN_YEAR]; if($year==$this->MIN_YEAR$month getLunarByBetween($year,$this->getDaysBetweenSolar...[详细]
-
PHP数据分析引擎计算余弦相似度算法示例
[PHP教程] 2021-02-22 17:34:24 145人阅读
本篇章节讲解PHP数据分析引擎计算余弦相似度算法。供大家参考研究具体如下: 关于余弦相似度的相关介绍可参考百度百科:余弦相似度 $val){ $in = $index.$key; $arrBack[$in] = $val; } return $arrBack;}/** * * @p...[详细]
-
PHP实现更改hosts文件的方法示例
[PHP教程] 2021-02-22 17:23:51 144人阅读
本篇章节讲解PHP实现更改hosts文件的方法。分享给大家供大家参考,具体如下: 有这样一个需求,我有多个网址希望在不同的时候对应不同的 ip,如果一个个配 hosts,这工作显得有些繁琐。写了如下脚本来批量更改。 del...[详细]
-
Yii2框架中使用PHPExcel导出Excel文件的示例
[PHP教程] 2021-02-22 17:13:47 105人阅读
最近在研究PHP的Yii框架,很喜欢,碰到导出Excel的问题,研究了一下,就有了下面的方法: 最简单的利用composer安装 如果没有安装conposer可以参考下面1.2步 1、引入PHPExcel 首先得要下载phpexcel地址:https://gith...[详细]
-
PHP并发查询MySQL的实例代码
[PHP教程] 2021-02-22 16:48:04 100人阅读
最近在研究PHP,很喜欢,碰到PHP并发查询MySQL的问题,研究了一下,顺便留个笔记: 同步查询 这是我们最常的调用模式,客户端调用Query[函数],发起查询命令,等待结果返回,读取结果;再发送第二条查询命令,等待结...[详细]
-
PHP编程实现脚本异步执行的方法
[PHP教程] 2021-02-22 16:46:35 189人阅读
本篇章节讲解PHP编程实现脚本异步执行的方法。供大家参考研究具体如下: php语言得用 fsockopen() 函数,实现脚本异步运行,代码如下 异步请求函数(用debug参数若为true则为用为调试,开启调试可以看到异步的执行情况,...[详细]
-
php实现的redis缓存类定义与使用方法示例
[PHP教程] 2021-02-22 16:39:17 60人阅读
本篇章节讲解php实现的redis缓存类定义与使用方法。供大家参考研究具体如下: php+redis缓存类 host = "127.0.0.1...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]