-
PHP和以太坊交互详解
[PHP教程] 2022-02-24 13:16:46 122人阅读
自去年以来,我们正在开发区块链(Blockchain)业务。最近使用过Ethereum并使用PHP,所以我想我们应该聊聊这个话题。 这里有个前提: 1.理解区块链 2.对编程语言有了解 本文的主要内容: 1.开发环境 2.以太坊的介绍 ...[详细]
-
运用PHP扩展Xhprof分析项目性能实践教程
[PHP教程] 2022-02-24 13:16:03 126人阅读
一、背景 项目即将上线,想通过一些工具来分析代码的稳定性和效率,想起在上个团队时使用过的xhprof扩展;因为换了新电脑,所以需要重新编译此扩展,现将安装与实际排查过程完整记录下来,方便自己回顾和帮助更多的...[详细]
-
运用PHPExcel导出Excel表
[PHP教程] 2022-02-24 13:15:40 51人阅读
本文实例为大家分享了PHPExcel导出Excel表的具体代码,供大家参考,具体内容如下: /** * Excel导出 * @param $fileName(文件名) * @param $headArr (表头) * @param $data (每一行的数据) * @throws /PHPExce...[详细]
-
PHP中创建和编辑Excel表格的办法
[PHP教程] 2022-02-24 13:15:12 115人阅读
要使用纯PHP创建或编辑Excel电子表格,我们将使用PHPExcel库,它可以读写许多电子表格格式,包括xls,xlsx,ods和csv。在我们继续之前,仔细检查您的服务器上是否有PHP 5.2或更高版本以及安装了以下PHP扩展:php_zip...[详细]
-
解析php协程知识点
[PHP教程] 2022-02-24 13:14:47 71人阅读
在讲协程之前,先谈谈多进程、多线程、并行和并发。 对于单核处理器,多进程实现多任务的原理是让操作系统给一个任务每次分配一定的 CPU 时间片,然后中断、让下一个任务执行一定的时间片接着再中断并继续执行下一个...[详细]
-
php curl调用接口显示HTTP Status 415怎样解决
[PHP教程] 2022-02-24 13:10:00 170人阅读
使用php curl的方式调用对方提供的接口,收到了如下错误提示 HTTP Status 415 The server refused this request because the request entity is in a format not supported by the requested resource for the reque...[详细]
-
PHP实现多线程的两个办法 PHP+shell
[PHP教程] 2022-02-24 13:09:20 200人阅读
PHP+shell实现多线程的方法 先写个简单的php代码,这里为了让脚本执行时间更长,方便看效果,sleep一下,呵呵!先看下test.php的代码:ls PHP代码: ?php for ($i=0;$i10;$i++) { echo $i; sleep(10); } ? 在看下shel...[详细]
-
PHP浮点数运算精度的情况
[PHP教程] 2022-02-24 13:08:48 186人阅读
在用PHP进行浮点数的运算中,遇到一个坑,没有得到预期中的结果,如下代码: $a = 69.1; $b = $a*100; $c = $b-6910; 你猜$c的值是多少?$c输出的值是-9.0949470177293E-13.为什么会这样? 在PHP官网Float浮点型页面...[详细]
-
php正确输出json数据的实例讲解
[PHP教程] 2022-02-24 13:08:11 115人阅读
错误示例: $result = array(state=123,message =参数错误); echo hello; echo json_encode($result); 客户端先接收到第一个echo语句 但并不是json数据。 另外一种情况是执行了语句mysqli_close(),关闭了数据库导致...[详细]
-
PHP防止SQL注入的例子
[PHP教程] 2022-02-24 13:07:49 96人阅读
使用prepared以及参数绑定查询可根本性防止sql注入的发生:SQL语句与参数分批传输到sql服务器的方式让利用字符串拼接的SQL注入没有了施展空间。 基本上你有两种方式完成上述方法: 使用PDO: $stmt = $pdo-prepare(SE...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]