php
liangyely
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
在PHP语言中使用JSON
一、json_encode() 该函数主要用来将数组和对象,转换为json格式。先看一个数组转换的例子: $arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5); echo json_encode($arr); 结果为 {"a":1,"b":2,"c":3,"d":4,"e":5} 再看一个转载 2017-10-21 11:09:18 · 273 阅读 · 0 评论 -
php发送post请求的三种方法
方法一: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 /** * 发送post请求 * @param string $url 请求地址 * @param array $转载 2017-10-21 11:05:35 · 17616 阅读 · 0 评论 -
解决PHP的“No input file specified”的问题
问题描述:使用TP框架做项目时,在启用REWRITE的伪静态功能的时候,首页可以访问,但是访问其它页面的时候,就提示:“No input file specified.” 原因在于使用的PHP5.6是fast_cgi模式,而在某些情况下,不能正确识别path_info所造成的错误 默认的.htaccess里面的规则: IfModule mod_rewrite.c> Options +转载 2018-02-02 14:46:50 · 715 阅读 · 0 评论 -
架设的PHP网页打开超级慢
phpinfo 访问下看看速度 如果正常 说明是数据库服务器的问题, 通常是数据库连接设置不好,如数据库正常设置连接: 'hostname' => '127.0.0.1', 如果设置为'localhost',将龟速转载 2018-02-02 14:51:35 · 2038 阅读 · 2 评论 -
PHP创建uuid
md5(uniqid(microtime(true),true).uniqid(microtime(true),true)); 可以 md5(uniqid(microtime(true),true).uniqid(microtime(true),true)); 提升性能原创 2018-02-04 13:01:19 · 393 阅读 · 0 评论 -
PHP获取客户端操作系统,浏览器,语言,IP,IP归属地等
class Client { ////获得访客浏览器类型 function Get_Browser(){ if(!empty($_SERVER['HTTP_USER_AGENT'])){ $br = $_SERVER['HTTP_USER_AGENT']; if (preg_match('/MSIE/i',$br)) { $br = 'MSIE';转载 2018-02-06 15:10:15 · 804 阅读 · 0 评论 -
thinkphp5的多语言功能
1、配置文件 : 'lang_switch_on' => true, 'lang_list' => ['zh-cn','en-us','ts'], 2、在当前模块下建立文件夹:lang 3、在文件夹内部分别建立php文件: zh-cn.php en-us.php ts.php zh-cn.php内容:<?php retur转载 2018-02-12 12:16:41 · 3741 阅读 · 0 评论 -
php中table导出为Excel
public function save_as_excel($f3){ $filename = 'report'; header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment;Filename=".$filename.".xls"); echo "<htm...转载 2018-09-30 11:53:12 · 1945 阅读 · 0 评论
分享