摘要: $json="[{ 'i':100000, 'u':-1,n: '中国'},{i:100001,u:-1,n:'阿尔巴尼亚'},{i:100002,u:-1,n:'阿尔及利亚',}]";$json = preg_replace('/([{,:])(\s*)\'(.*?)\'/','$1"$3"... 阅读全文
posted @ 2015-04-17 15:48 我来也1010 阅读(770) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2015-04-15 20:03 我来也1010 阅读(4) 评论(0) 推荐(0) 编辑
摘要: curl get: 1)直接输出 2)curl_get函数 curl_post 函数: 携带header post 新版 curl:request curl post get curlRequest:(new) 阅读全文
posted @ 2015-04-15 18:56 我来也1010 阅读(336) 评论(0) 推荐(0) 编辑
摘要: class PDOHelper{ public static $db =null;// new PDO('mysql:host=192.168.1.68;dbname=test','root','123456'); public static function _co... 阅读全文
posted @ 2015-04-15 14:24 我来也1010 阅读(258) 评论(0) 推荐(0) 编辑
摘要: function write_log($msg,$isEcho=false,$path=''){ $path?'':$path='logs'.DIRECTORY_SEPARATOR.'log'.date('Ymd',time()).'.txt'; if(!is_dir(dirname($path))){ mkdir(dirname(... 阅读全文
posted @ 2015-04-15 09:46 我来也1010 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 转载请说明出处:http://blog.csdn.net/cywosp/article/details/23397179 一致性哈希算法在1997年由麻省理工学院提出的一种分布式哈希(DHT)实现算法,设计目标是为了解决因特网中的热点(Hot spot)问题,初衷和CARP十分类似。一致性哈希修正... 阅读全文
posted @ 2015-04-14 14:28 我来也1010 阅读(147) 评论(0) 推荐(0) 编辑
摘要: php 代码 $input='中国'; $result= md5($input); $temp=iconv("UTF-8", "UTF16LE", $input); echo m... 阅读全文
posted @ 2015-03-20 19:29 我来也1010 阅读(331) 评论(0) 推荐(0) 编辑
摘要: autoload.php$action();}echo json_encode($res); 阅读全文
posted @ 2015-03-20 15:22 我来也1010 阅读(224) 评论(0) 推荐(0) 编辑
摘要: md5(uniqid(microtime(true),true)) 阅读全文
posted @ 2015-01-29 11:52 我来也1010 阅读(268) 评论(0) 推荐(0) 编辑
摘要: fp, 4)); return $result['long']; } /** * 返回读取的3个字节的长整型数 * * @access private * @return int */ function get... 阅读全文
posted @ 2014-12-16 17:03 我来也1010 阅读(867) 评论(0) 推荐(0) 编辑