摘要: <?phpclass Calendar{ var $T = array(); var $MonthDays = array('1'=>'31','2'=>'28','3'=>'31','4'=>'30','5'=>'31','6'=>'30','7'=>'31','8'=>'31', 阅读全文
posted @ 2016-06-15 17:20 lpfjsbk 阅读(177) 评论(0) 推荐(0) 编辑
摘要: <?php /** * curl多线程下载类 */class MultiHttpRequest{ public $urls = array (); private $res = array (); private $curlopt_header = 0; private $method = "GET 阅读全文
posted @ 2016-06-15 17:15 lpfjsbk 阅读(523) 评论(0) 推荐(0) 编辑
摘要: <?php /** * PHP memcache 环形队列类 * 因业务需要只保留的队列中的Pop和Push,修改过期时间为0即永久 */ class MQueue { public static $client; private $expire; //过期时间,秒,1~2592000,即30天内 阅读全文
posted @ 2016-06-15 16:01 lpfjsbk 阅读(677) 评论(0) 推荐(0) 编辑
摘要: <?php function quicksort($str){ if(count($str)<=1) return $str;//如果个数不大于一,直接返回 $key=$str[0];//取一个值,稍后用来比较; $left_arr=array(); $right_arr=array(); for( 阅读全文
posted @ 2016-06-15 15:22 lpfjsbk 阅读(117) 评论(0) 推荐(0) 编辑
摘要: class Request{ public static function post($url, $post_data = '', $timeout = 5){//curl $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_s 阅读全文
posted @ 2016-06-15 15:18 lpfjsbk 阅读(405) 评论(0) 推荐(0) 编辑
摘要: <?php /** * Memcache缓存操作 * @author hxm * @version 1.0 * @since 2015.05.04 */ class MCache extends Object implements CacheFace { private $mem = null; / 阅读全文
posted @ 2016-06-15 15:15 lpfjsbk 阅读(225) 评论(0) 推荐(0) 编辑
摘要: <?php /** * Redis缓存操作 * @author hxm * @version 1.0 * @since 2015.05.04 */ class RCache extends Object implements CacheFace { private $redis = null; // 阅读全文
posted @ 2016-06-15 15:14 lpfjsbk 阅读(137) 评论(0) 推荐(0) 编辑
摘要: class ArrayHelper{ /** * 从数组中删除空白的元素(包括只有空白字符的元素) * * 用法: * @code php * $arr = array('', 'test', ' '); * ArrayHelper::removeEmpty($arr); * * dump($arr 阅读全文
posted @ 2016-06-15 15:10 lpfjsbk 阅读(777) 评论(0) 推荐(0) 编辑
摘要: <?php function validateEmail($email) { $isValid = true; $atIndex = strrpos($email, "@"); if (is_bool($atIndex) && !$atIndex) { $isValid = false; } els 阅读全文
posted @ 2016-06-15 15:09 lpfjsbk 阅读(292) 评论(0) 推荐(0) 编辑
摘要: <?php function RandAbc($length=""){//返回随机字符串 $str="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; return str_shuffle($str); } $filepath='index 阅读全文
posted @ 2016-06-15 15:07 lpfjsbk 阅读(266) 评论(0) 推荐(0) 编辑