随笔分类 -  PHP

php
摘要:$value) { _stripslashes($value); } } else { $var = stripslashes($var); } return $var;}function _escape_string($data, $encoding = 'UTF-8') { ret... 阅读全文
posted @ 2015-08-05 14:49 Adtuu 阅读(293) 评论(0) 推荐(0)
摘要:getSessionFromRedirect();} catch(FacebookRequestException $ex) { // When Facebook returns an error echo '1:'; var_dump($ex->getMessage());} ... 阅读全文
posted @ 2015-07-30 09:53 Adtuu 阅读(457) 评论(0) 推荐(0)
摘要:'a','con'=>'b');$b[] = $a;var_dump($b);echo '';$aa[]['son2'] = array('name' =>'a','con'=>'b');var_dump($aa);exit;*/header('Content-type:text/html;char... 阅读全文
posted @ 2015-07-30 09:52 Adtuu 阅读(352) 评论(0) 推荐(0)
摘要:'4月以降、遺体の捜索活動が続けられてきたが');$sJSON = json_encode($s);var_dump($sJSON); // 会转换成16进制var_dump(json_decode($sJSON));$sJSON = json_encode($s, defined('JSON_UN... 阅读全文
posted @ 2015-07-30 09:52 Adtuu 阅读(371) 评论(0) 推荐(0)
摘要:buffer(); } /** * * The music download data while playing(音乐边下载数据边播放) * @param $data */ public function buffer() { ... 阅读全文
posted @ 2015-07-30 09:51 Adtuu 阅读(396) 评论(0) 推荐(0)
摘要:$key = 'test';$result_array = array('name' => 'ta', 'age' => 28);$str = encode($result_array);function encode($result_array) { global $key;//... 阅读全文
posted @ 2015-07-30 09:50 Adtuu 阅读(210) 评论(0) 推荐(0)
摘要:function getDistanceBetweenPointsNew($latitude1, $longitude1, $latitude2, $longitude2) { $theta = $longitude1 - $longitude2; $miles = (sin(deg2r... 阅读全文
posted @ 2015-07-30 09:49 Adtuu 阅读(272) 评论(0) 推荐(0)
摘要:$headers = array( "TYPE:xxxxooooo", "TOKEN:00000000");$data = array( 'data' => array('name' => 'test','AGE'=>22), 'registration_ids' => ar... 阅读全文
posted @ 2015-07-30 09:48 Adtuu 阅读(985) 评论(0) 推荐(0)
摘要:var crypto = require('crypto');function decode(cryptkey, iv, secretdata) { var decipher = crypto.createDecipheriv('aes-256-cbc', cryptkey, iv), ... 阅读全文
posted @ 2015-07-30 09:45 Adtuu 阅读(806) 评论(0) 推荐(0)
摘要:function get_long_time($date){ $curr = time(); $date = strtotime($date); $tmp = $curr - $date; if($tmp < 60){ $re = $tmp.'秒前'; }... 阅读全文
posted @ 2015-07-30 09:44 Adtuu 阅读(259) 评论(0) 推荐(0)
摘要:index.htmlLoginadmincp.php $_GET['auth_username'], 'auth_password' => $_GET['auth_password'] ); $url = 'http://www.adtuu-server.com/login... 阅读全文
posted @ 2015-07-30 09:42 Adtuu 阅读(190) 评论(0) 推荐(0)
摘要:arA['R'] = ($this->colorA >> 16) & 0xFF; $this->arA['G'] = ($this->colorA >> 8) & 0xFF; $this->arA['B'] = $this->colorA & 0xFF; $... 阅读全文
posted @ 2015-07-30 09:41 Adtuu 阅读(284) 评论(0) 推荐(0)
摘要:', $file_type, ' code:', $type_code, ''; } 阅读全文
posted @ 2015-07-30 09:40 Adtuu 阅读(1408) 评论(0) 推荐(0)
摘要:<?phpini_set('session.use_only_cookies', 0);$session_id = rand(10000, 99999);session_set_cookie_params( 0, '/', NULL, false, true);sess... 阅读全文
posted @ 2015-07-30 09:39 Adtuu 阅读(271) 评论(0) 推荐(0)
摘要:库存超卖的问题作描述:一般电子商务网站都会遇到如团购、秒杀、特价之类的活动,而这样的活动有一个共同的特点就是访问量激增、上千甚至上万人抢购一个商品。然而,作为活动商品,库存肯定是很有限的,如何控制库存不让出现超买,以防止造成不必要的损失是众多电子商务网站程序员头疼的问题,这同时也是最基本的问题。从技... 阅读全文
posted @ 2015-07-30 09:37 Adtuu 阅读(6900) 评论(0) 推荐(0)
摘要:Luhn算法会通过校验码对一串数字进行验证,校验码通常会被加到这串数字的末尾处,从而得到一个完整的身份识别码。我们以数字“7992739871”为例,计算其校验位:从校验位开始,从右往左,偶数位乘2(例如,7*2=14),然后将两位数字的个位与十位相加(例如,10:1+0=1,14:1+4=5);把... 阅读全文
posted @ 2015-07-30 09:35 Adtuu 阅读(1433) 评论(0) 推荐(1)
摘要:header("Content-Type: text/html;charset=utf-8");//输出不乱码,你懂的$total=10;//红包总额$num=8;// 分成8个红包,支持8人随机领取$min=0.01;//每个人最少能收到0.01元for ($i=1;$i';}echo '第'.$... 阅读全文
posted @ 2015-07-30 09:34 Adtuu 阅读(191) 评论(0) 推荐(0)
摘要:vhost设定http.conf AllowOverride none #Require all deniedvhost.conf #ServerAdmin webmaster@dummy-host2.example.com DocumentRoot "/Users/zhoutingze/proje... 阅读全文
posted @ 2015-07-30 09:21 Adtuu 阅读(180) 评论(0) 推荐(0)
摘要:Now you need to find out what version of PHP is installed on OSX$ php -vPHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 20 2012 22:55:53) Copyright (c... 阅读全文
posted @ 2015-07-30 09:19 Adtuu 阅读(3282) 评论(0) 推荐(0)
摘要:libevent扩展安装libevent-2.0.16-stable.tarhttp://libevent.org/[plain]view plaincopycdlibevent-2.0.16-stable./configuremakemakeinstall下载php-libeventc 扩展ht... 阅读全文
posted @ 2015-07-30 09:18 Adtuu 阅读(117) 评论(0) 推荐(0)