摘要: Ctrl+Shift+F 阅读全文
posted @ 2013-12-27 10:47 kwishly 阅读(149) 评论(0) 推荐(0) 编辑
摘要: cache_expire=$exp_time; $this->cache_path=$path; $this->CreateFolder($path); } //returns the filename for the cache private function fileName($key){ return $this->cache_path.$key; } //creates new cache files with the given data, $key== name of the cache, data the info/values to store public 阅读全文
posted @ 2013-12-25 17:58 kwishly 阅读(227) 评论(0) 推荐(0) 编辑
摘要: function curlBy($url, $data=array()) { $ch = curl_init(); if(!empty($data)){ if (is_array($data) && $data) { $formdata = http_build_query($data); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $formdata); } } curl_setopt($ch, CURLOPT_URL, $url); curl_se... 阅读全文
posted @ 2013-12-25 17:23 kwishly 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-12-19 10:22 kwishly 阅读(161) 评论(0) 推荐(0) 编辑
摘要: if(/^(1\d{10})\s(\S+)$/.test(cmdParam)) 阅读全文
posted @ 2013-12-06 11:48 kwishly 阅读(409) 评论(0) 推荐(0) 编辑
摘要: /^(13|14|15|18)\d{9}$/ 阅读全文
posted @ 2013-12-05 17:29 kwishly 阅读(239) 评论(0) 推荐(0) 编辑
摘要: $imageInfo[0],"height" => $imageInfo[1],"type" => $imageType,"size" => $imageSize,"mime" => $imageInfo['mime']);return $info;} else {return FALSE;}}$info = getImageInfo('test.jpg');var_dump($info);?> 阅读全文
posted @ 2013-12-03 10:13 kwishly 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 百度分享默认分享的是当前页的url,但也可以在同一个页面中分享多个不同的url,仅需进行如下简单的配置。默认的代码如下:其实是有很多隐藏的参数的:如果想自定义url,只需要写如下代码即可,红色文字部分就是增加的url: 更多 新浪 腾讯 人人 QQ 参考资料:http://share.baidu.com/help/customization/config 阅读全文
posted @ 2013-11-25 17:14 kwishly 阅读(7389) 评论(0) 推荐(0) 编辑
摘要: nginx的400错误比较难查找原因,因为此错误并不是每次都会出现的,另外,出现错误的时候,通常在浏览器和日志里看不到任何有关提示。经长时间观察和大量试验查明,此乃request header过大所引起,request过大,通常是由于cookie中写入了较大的值所引起。所幸在nginx中是有办法解决这个问题:在nginx.conf中,将client_header_buffer_size和large_client_header_buffers都调大,可缓解此问题。其中主要配置是client_header_buffer_size这一项,默认是1k,所以header小于1k的话是不会出现问题的。按我 阅读全文
posted @ 2013-11-25 15:36 kwishly 阅读(26049) 评论(1) 推荐(0) 编辑
摘要: 今天遇到一个问题,json_decode解析json数据返回null,试了各种方法都不行,最后发现,原来是json文件编码的问题。当json_decode解析utf-8带BOM格式的json数据时,会返回null。json_decode函数能够接收utf8编码的参数,但是当参数中包含BOM时,json_decode就会失效。这个函数能将给定的字符串转换成UTF-8编码,移除其中的BOM。下面是PHP代码:function prepareJSON($input) { //This will convert ASCII/ISO-8859-1 to UTF-8. //Be carefu... 阅读全文
posted @ 2013-11-22 15:46 kwishly 阅读(3035) 评论(0) 推荐(0) 编辑