-
PHP字符变量奇怪现象的解析
[PHP教程] 2022-02-23 15:43:37 167人阅读
首先神奇的PHP是支持字符数据类型的,有同学就写了这样一段代码: for ($c = a; $c = z; $c++) { echo $c . ; } 然而结果却不是他想要的a到z a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae a...[详细]
-
php给变量取个简短且没歧义的名字
[PHP教程] 2022-02-23 15:42:58 77人阅读
代码审计至少包含两个方面首先要确定代码的目的或功能;另外就是检查代码的可读性,即是否更利于理解和维护。 或许你审计过很多代码,太长的变量名确实很让人抓狂。不仅影响了代码的清晰度,而且过长的变量让你的代...[详细]
-
php 常用header常用示例
[PHP教程] 2022-02-23 15:42:30 138人阅读
这里记录下常用header的信息: ?php header(HTTP/1.1 200 OK); // ok 正常访问 header(HTTP/1.1 404 Not Found); //通知浏览器 页面不存在 header(HTTP/1.1 301 Moved Permanently); //设置地址被永久的重定向 301 h...[详细]
-
php curl multi 多线程查询的示例
[PHP教程] 2022-02-23 15:42:07 172人阅读
PHP自身没有多线程的,可以借助扩展实现。但是curl_multi* 函数实现了多线程访问网站数据的功能。 步骤总结如下: 第一步:调用curl_multi_init 第二步:循环调用curl_multi_add_handle 这一步需要注意的是,curl_mu...[详细]
-
php系统日志切割的示例
[PHP教程] 2022-02-23 15:41:44 70人阅读
我习惯设置的日志路径是这样 /home/www/logs/域名.log 比如: /home/www/logs/www.Cuoxin.com.log 为了方便管理,日志需要按天保存在一个文件中,并且保留指定天数的日志,超过时间的就删除。 分享一下脚本: #!/usr/b...[详细]
-
PHP Opcode缓存加快组件 APC模块安装使用
[PHP教程] 2022-02-23 15:41:04 153人阅读
什么是opcode 也许你曾经尝试过用C/C++编写动态内容,虽然开发过程极其繁琐,但为了获得性能提升,这样做或许是值得的,它们可以将动态内容编译成二进制可执行文件,也就是目标代码,由操作系统进程直接装载运行。如...[详细]
-
阿里云直播PHP SDK使用方法解析
[PHP教程] 2022-02-23 15:40:24 95人阅读
1、直播云没有单独的SDK,直播部分的SDK是直接封装在CDN的相关的SDK里面 2、针对SDK,没有demo。 3、针对SDK,没有相关的文档说明。 4、针对SDK的说明,网站上面的说明与源码里面的说明完全不一致。 5、针对SDK没有...[详细]
-
php中socket服务的模型下的编程方法
[PHP教程] 2022-02-23 15:40:00 105人阅读
前面我们花了一段时间来搭建高性能的socket服务,可以同时处理大量的连接,但这是在没有具体业务的情况下。 如果我们启用了一个单进程的server,但里面的一个业务耗时1秒,那么在这1秒内是阻塞的,后续的请求会等待,...[详细]
-
php socket服务的模型以及完成多进程IO复用libe
[PHP教程] 2022-02-23 15:39:26 141人阅读
端口复用技术,这样就可以很好的解决惊群问题和stream_socket_server性能瓶颈的问题. /** * 多进程IO复用libevent * 同时处理多个连接 * 端口复用---建议php7 */ class Xtgxiso_server { public $socket = false; pu...[详细]
-
PHP中的浅复制与深复制的实例解析
[PHP教程] 2022-02-23 15:37:48 135人阅读
前言:最近温习了一下Design Pattern方面的知识,在看到Prototype Pattern这一设计模式时,注意到其中涉及到一个浅复制与深复制的问题。这里来总结一下,提醒自己以后一定要多加注意。 自PHP5起,new运算符自动返回...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]