-
PHP fwrite换行写入时换行符不起作用的因素
[PHP教程] 2022-02-24 13:22:42 109人阅读
php的换行符我们都知道:/n ,回车符:/r,在需要换行时,通常是用/r/n这个组合。但是为什么我们在使用fwrite写入文件时/n换行符不起作用呢。我们先看下面这个例子: ?php $filename = file.txt; $word = 你好!/r/n...[详细]
-
php Function eregi is deprecated 处理方案
[PHP教程] 2022-02-24 13:22:18 188人阅读
首先说下ereg()与eregi()的区别: ereg()字符串对比匹配函数,区分字符串大小写; eregi()字符串对比匹配函数,不区分字符串大小写. 这两个函数在php正则里经常会用到,但是由于php5.3以后的版本不再支持此函数,如果...[详细]
-
php的flush和ob flush无效问题解决方法
[PHP教程] 2022-02-24 13:21:48 133人阅读
我的基础环境是nginx1.6.2+php5.3,做一个逐行输出,使用ob_flush时试了N种方法不起作用,比如下面的代码: ?php ob_start(); for(;;) { echo br.......; ob_flush(); flush(); sleep(1); } ? 谷歌了不少的写法都不行...[详细]
-
php foreach循环运用引用注意事项
[PHP教程] 2022-02-24 13:21:19 108人阅读
看过PHP相关书籍的都会了解到PHP有个这样的特性:写时复制,所以在用foreach时,需要对数据做修改的时候,都会复制数据,如果数据很大,那么就会带来一定的内存消耗,所以为了避免这种复制操作,就用到了引用,下面...[详细]
-
PHP函数gzuncompress无法使用的问题解决方法
[PHP教程] 2022-02-24 13:20:50 94人阅读
解决过程: 1.gzuncompress函数需要zlib支持才可以正常使用 2.可以使用探针检查当前php版本中是否已经开启了该函数 3.解决方式,额外编译php,安装zlib组件 解决步骤: 1.开发环境为centos6.5 bit php5.3 2.参考代码(...[详细]
-
PHP完成表单提交时去除斜杠的教程
[PHP教程] 2022-02-24 13:20:25 73人阅读
本文实例讲述了PHP实现表单提交时去除斜杠的方法,分享给大家供大家参考,具体如下: html head titleHTML 表单/title /head body form action=method=POST 请输入一个字符串: input type=textsize=30name=strvalue...[详细]
-
PHP截取中文字符串没出现?号怎么办
[PHP教程] 2022-02-24 13:19:47 199人阅读
本文实例讲述了PHP实现截取中文字符串不出现?号的解决方法,分享给大家供大家参考,具体如下: 当PHP截取中英文混合字符串时,最后一个汉字经常被拆成两半,例:截取字符串的前18个字,代码如下: ?php $text=1欢迎访...[详细]
-
PHPExcel在linux环境下导出报500错误的解决办法
[PHP教程] 2022-02-24 13:19:18 80人阅读
原先我导出为 XLSX 格式,用的是如下代码: $objWriter= IOFactory::createWriter($objPHPExcel,Excel2007); 报错,纠结就纠结在,在开发环境和测试环境都没问题,放在生产环境直接 500 错误。 后来我改成导出 XLS 格...[详细]
-
总结了php时间解决问题
[PHP教程] 2022-02-24 13:18:06 109人阅读
问题就是通过一个时间处理 echo date(Ymd, strtotime(+1 month, strtotime(20150130)) ); 按照朋友的想法,应该输出的是20150227 ,而实际输出的是20150302 也就是说1月的29,30,31号输出都是3月份的天数,并不是想要...[详细]
-
php 502 bad gateway的处理方案
[PHP教程] 2022-02-24 13:17:21 173人阅读
今天升级完PHP出现了502 Bad Gateway错误,根据经验是php-fpm的问题,但是看到网上那些什么访问量,子进程设置什么的,但是我这太服务器压根没啥流量。所以只能从配置文件下手看看。 [global] pid = /usr/local/php/...[详细]
- 这篇文章主要介绍了Laravel 5.0 发布 新版本特性详解,...[详细]
- 计算两个日期之间的时间差需要先把两个日期转换成纪元...[详细]
- 初步使用面向对象程序设计,要掌握的就是使用面向对象...[详细]
- 每个 PHP 数组内部都有一个指针,该指针指向数组的某...[详细]
- 因为 PHP 是一个 Web 编程语言,在编程过程中难免会遇...[详细]
- PHP 中提供了 return 语句来返回函数的运行结果,其语...[详细]
- final 关键字的作用如下: 使用 final 修饰的类,不能...[详细]
- 在使用 switch 语句时应该注意以下几点: 和 if 语句...[详细]
- 这篇文章主要给大家介绍了关于PHP替换Word中变量并导...[详细]
- 这篇文章主要介绍了PHP常量DIRECTORY_SEPARATOR原理及...[详细]