随笔分类 -  php

php
linux定时任务
摘要:如何设置定时任务常用命令crontab -e //编写 * * * * * /usr/bin/php /data/www/12.phpcrontab -l //查看 l列出详细crontab -t //删除没有分钟 小时 日 月 星期 命令*/1每分钟php案... 阅读全文

posted @ 2015-04-16 14:58 < Angus > 阅读(188) 评论(0) 推荐(0)

php缓存技术 静态缓存 memcache缓存 redis缓存
摘要:php操作缓存生成获取删除 1 class file{ 2 private $_dir; 3 const EXT='.txt'; 4 public function __consruct(){ 5 $this->_dir dirname(__FILE___)... 阅读全文

posted @ 2015-04-16 14:09 < Angus > 阅读(678) 评论(0) 推荐(0)

php 封装json xml通讯数据方法 php开发APP接口
摘要://php开发APP接口class Response{ const JSON="json"; public static function show($code,$message,$data=array(),$type=self::JSON){ if(!is_numeric($code)... 阅读全文

posted @ 2015-04-16 13:42 < Angus > 阅读(518) 评论(0) 推荐(0)

uncode转utf8和中文
摘要:有时就是没有加header头信息。网站的中文乱码:如果是◇?◇◇◇◇?◇◇◇◇◇ 样子的。就是需要gbk 的header头信息。 用代码方式编码,并不适合页面转码工作,是行不通的。header("Content-type: text/html; charset=gb2312"); 阅读全文

posted @ 2015-03-19 13:05 < Angus > 阅读(526) 评论(0) 推荐(0)

PHP简单实用的缓存函数
摘要:/*** @说明: 文件缓存输出* @参数: $cachefile => cache文件(绝对路径)* @参数: $pertime => 缓存输出的间隔时间* @参数: $sql => sql语句* @参数: $templatefile => 模板文件名称(绝对路径)**/function __ca... 阅读全文

posted @ 2015-01-07 17:50 < Angus > 阅读(1121) 评论(0) 推荐(0)

php文件上传下载
摘要:片名: 请上传大片: pHp:"; var_dump($_POST); echo "";*/ //1.观察数组 /*echo ""; var_dump($_FILES); echo "";*/ $file ... 阅读全文

posted @ 2014-12-15 10:45 < Angus > 阅读(333) 评论(0) 推荐(0)

TMD 去掉双引号我就不用正则表达式!!!
摘要:<?php$str="'你好123'";echo $str;$res = trim($str,"\'\'");echo $res;'你好123'你好123<?php$str="\"你好123\"";echo $str;$res = trim($str,"\"\"");echo $res;"你好123... 阅读全文

posted @ 2014-12-10 17:42 < Angus > 阅读(329) 评论(0) 推荐(0)

php获取excel表格中数据的小方法 然后就可以放到数据库了
摘要:现在又一个product.xml的表格文件,要求取出其中数据数据如下:商品名价格iphone4s4199note23999小米21999iphone548991,将product.xml另存为product.csv文件2,用fgetcsv函数取出其中的数据放到一个数组中(fgetcsv — 从文件指... 阅读全文

posted @ 2014-09-19 10:38 < Angus > 阅读(270) 评论(0) 推荐(0)

相同Ip 不同端口配置Nginx反向代理Apache
摘要:相同Ip 不同端口 配置Nginx反向代理Apache(就是Nginx跳转到Apache)在linux 一经搭建好环境 先后安装了Nginx 和Apache 由于 默认端口都是:80一般客户请求的服务器端口默认为80 所以Nginx作为静态页端口设置:80 Apache设置端口为:8080(在ht... 阅读全文

posted @ 2014-07-28 23:04 < Angus > 阅读(3295) 评论(2) 推荐(0)

PHP数组和Json之间的转换
摘要:PHP数组和Json之间的转换http://www.cnblogs.com/xmphoenix/archive/2011/05/26/2057963.html对象和Json之间的转换http://www.cnblogs.com/konbluesky/articles/2098587.html php数组使用json_encode函数中文被编码成null的原因和解决办法 json格式在开发中用的十分广泛。在php中json_encode函数可以直接将数组转成 json格式,十分方便。但是有可能你在使用json_encode函数时,无奈的发现中文被编码成null了。原来json只支持转... 阅读全文

posted @ 2014-03-31 14:01 < Angus > 阅读(485) 评论(0) 推荐(0)

导航