-
深入php之规范编程命名小总结
[PHP教程] 2022-07-12 11:52:42 63人阅读
在之前工作的时候都未注重自己的命名规范,现在根据驼峰命名严格要求自己: 相关的定义如下 基本概念 骆驼式命名法(又称驼峰命名法),正如它的名称CamelCase所表示的那样,是指混合使用大小写字母来构成变量和函数...[详细]
-
基于php缓存的细解
[PHP教程] 2022-07-12 11:51:42 85人阅读
nginx缓存 nginx有两种缓存机制:fastcgi_cache和proxy_cache 下面我们来说说这两种缓存机制的区别吧 proxy_cache作用是缓存后端服务器的内容,可能是任何内容,包括静态的和动态的 fastcgi_cache作用是缓存fastcgi生...[详细]
-
PHP解决excel cvs表格的方法实例介绍
[PHP教程] 2022-07-12 11:51:15 168人阅读
复制代码 代码如下:www.CuoXIn.com PRE class=php name=code?php $data = array(); //convert a cvs file to an array $data $handle = fopen(data.csv,r); while ($curline = fgetcsv($handle, 1000, ,)){ $tmp = a...[详细]
-
基于php实现长连接的方法及注意事项的问题
[PHP教程] 2022-07-12 11:50:40 189人阅读
php可以通过set_time_limit(0);来取消php脚步超时限制,从而达到长连接的效果。 例子代码如下: 复制代码 代码如下:www.CuoXIn.com ?php echo 每隔3秒输出一次br /; set_time_limit(0); //保证php程序运行不超时退出...[详细]
-
剖析PHP缓存函数的使用说明
[PHP教程] 2022-07-12 11:50:15 179人阅读
flush():刷新输出程序缓存 for($i = 0; $i 5; $i++){ echo str_repeat(/n, 5000); echo $i; sleep(1); flush(); } ob_start(回调函数,限定长度,随时输出缓存=true):开启,前提:output_buffer = on ob_clear():...[详细]
-
PHP 类有关函数的使用详解
[PHP教程] 2022-07-12 11:49:51 181人阅读
bool class_alias ( string $original , string $alias [, bool $autoload = TRUE ] ) ― 为一个类创建别名 bool class_exists ( string $class_name [, bool $autoload ] )― 检查类是否已定义 string get_called_c...[详细]
-
PHP 自定义错误处理函数的用法详解
[PHP教程] 2022-07-12 11:49:16 170人阅读
复制代码 代码如下:www.CuoXIn.com function myErrorHandler($errno, $errstr, $errfile, $errline){ if(!(error_reporting() $errno)){return;} switch ($errno){ case E_USER_ERROR: echo bMy ERROR/b [$errno] $e...[详细]
-
基于PHP比较常用函数的用法详解
[PHP教程] 2022-07-12 11:48:37 62人阅读
复制代码 代码如下:www.CuoXIn.com ?php //===============================时间日期=============================== //y返回年最后两位,Y年四位数,m月份数字,M月份英文。d月份几号数字,D星期几英文 $date=date...[详细]
-
深入PHP数据缓存的使用介绍
[PHP教程] 2022-07-12 11:47:58 188人阅读
复制代码 代码如下:www.CuoXIn.com ?php // http://www.jb51.net/article/23093.htm function set_cache($name, $value) { // 设置相对或者绝对目录,末尾不要加 / $cache_dir = ./cache; // 设置扩展名 $cache_exte...[详细]
-
基于PHP生成静态页的实现方法推荐
[PHP教程] 2022-07-12 11:47:00 100人阅读
t1.php 复制代码 代码如下:www.CuoXIn.com ?php // 方法一根据模版生成静态页面 // replaceTemplateString函数用于替换模板中指定字符串 function replaceTemplateString($templateString) { // 用来替换的变量 $tit...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]