随笔分类 -  php

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页
摘要:public function xxoo(){ $dir = '/home/wwwroot/default/tibaobao'; echo $this->countLine($dir) . "\n"; } public function countLine($dir) { $count = 0; ... 阅读全文
posted @ 2018-12-20 15:42 盘思动 阅读(928) 评论(0) 推荐(0)
摘要:[2222222-CB] => Array ( [0] => Array ( [hykno] => 2222222-CB [tcdk_fid] => 458B6D70-FB7F-47AE-8356-777777777777 [totalamount] => 0 [offsetamount] => 9 阅读全文
posted @ 2018-12-19 20:17 盘思动 阅读(294) 评论(0) 推荐(0)
摘要:public function tt(){ $param = array( array ( 'hykno' => '2222222-CB', 'tcdk_fid' => '458B6D70-FB7F-47AE-8356-777777777777', ... 阅读全文
posted @ 2018-12-17 21:15 盘思动 阅读(305) 评论(0) 推荐(0)
摘要://处理二维数组, 按照某个字段合并重复的,其余字段中部分字段保留,部分相加 public function deal_erwei_arr(){ $param = array( array ( 'hykno' => '2222222-CB', 'tcdk_fid'... 阅读全文
posted @ 2018-12-17 16:59 盘思动 阅读(718) 评论(1) 推荐(0)
摘要:PHP星期几获取代码: date("l"); //data就可以获取英文的星期比如Sundaydate("w"); //这个可以获取数字星期比如123,注意0是星期日 获取中文星期几: $weekarray=array("日","一","二","三","四","五","六"); //先定义一个数组e 阅读全文
posted @ 2018-12-15 15:46 盘思动 阅读(2391) 评论(0) 推荐(0)
摘要:/** * 分 转为 钱 */public static function cent2yuan($price) { return bcdiv($price,100,2);}/** * 元 转为 分 */public static function yuan2cent($price) { return 阅读全文
posted @ 2018-12-03 20:02 盘思动 阅读(236) 评论(0) 推荐(0)
摘要:$array = [ '0' => [ 'name' => '111', 'age' => '2', ], '1' => [ 'name' ... 阅读全文
posted @ 2018-11-28 21:22 盘思动 阅读(277) 评论(0) 推荐(0)
摘要:function addresstolatlag($address){ $url = 'http://api.map.baidu.com/geocoder/v2/?address='.$address.'&output=json&ak=xxxxxxxxxxxxxxx'; //http://lbsyu 阅读全文
posted @ 2018-11-08 18:10 盘思动 阅读(459) 评论(0) 推荐(0)
摘要:function dealed_array_merge($a,$b){ if ($a && !$b){ return $a; } if (!$a && $b){ return $b; } if ($a && $b){ return array_merge($a,$b); } return [];} 阅读全文
posted @ 2018-11-06 14:31 盘思动 阅读(268) 评论(0) 推荐(0)
摘要:public function set_s(){ $arr = [ ['one' => 6,'two' => 19], ['one' => 36,'two' => 3], ['one' => 26,'two' => 3], ['one' => 2,'two' => 84], ['one' => 5, 阅读全文
posted @ 2018-10-20 18:38 盘思动 阅读(685) 评论(0) 推荐(0)
摘要:* 用PHP自带array_multisort函数排序 ``` $data = [ ['volume' => 67, 'edition' => 2], ['volume' => 86, 'edition' => 1], ['volume' => 85, 'edition' => 6], ['volu 阅读全文
posted @ 2018-10-20 18:31 盘思动 阅读(1991) 评论(0) 推荐(0)
摘要:https://packagist.org/packages/phpoffice/phpword 阅读全文
posted @ 2018-10-10 16:06 盘思动 阅读(128) 评论(0) 推荐(0)
摘要:[ 2018-10-10T10:51:49+08:00 ] 218.93.209.11 GET new.worldsipo.com/admin.php[ error ] [2]scandir() has been disabled for security reasons[/home/wwwroot 阅读全文
posted @ 2018-10-10 11:02 盘思动 阅读(1467) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/zhensg123/p/8954175.html 博客文章少了个Expection.php 文件; common.php 阅读全文
posted @ 2018-09-17 16:44 盘思动 阅读(1933) 评论(0) 推荐(0)
摘要:$insertId = Db::name('user_address')->insertGetId($data);会插入数据,返回插入的 id //$flag = Db::name('user_address')->insert($data);插入数据,如果成功返回1; 阅读全文
posted @ 2018-09-13 10:29 盘思动 阅读(695) 评论(0) 推荐(0)
摘要:$insertId = Db::name('user_address')->insertGetId($data); //add=>insert, insert 返回值不再是插入的id;if ($_REQUEST['is_default'] == '1'){ Db::name('user_addres 阅读全文
posted @ 2018-09-12 17:43 盘思动 阅读(7297) 评论(0) 推荐(0)
摘要:$map = [ 'status' => 1, 'is_show' => 1,];$result = Db::name('coupon') ->where($map) ->where('total_number','exp',Db::raw('>`send_number`')) ->whereTim 阅读全文
posted @ 2018-09-11 11:57 盘思动 阅读(2238) 评论(0) 推荐(0)
摘要:第一步:在框架根目录config里面新建redis.php文件配置ip及端口:如下: 第二步:在根目录extend里新建module目录,并在其里面建Redis.php文件,文件内容如下: 第三步:在项目根目录thinkphp目录里helper.php里设置redis助手函数,加入如下内容: 第四步 阅读全文
posted @ 2018-09-09 18:15 盘思动 阅读(8049) 评论(1) 推荐(0)
摘要:$baseGoodIds_arr = [1,2,3,4,5,6,7,8,9];$relate_gimgs = D('GoodsImages')->where(['good_id' => ['in',$baseGoodIds_arr]])->limit($gimgs_limit)->group('we 阅读全文
posted @ 2018-09-07 17:48 盘思动 阅读(1799) 评论(2) 推荐(0)
摘要://获取图片大小 public function getimgweight(){ $url = 'http://cdn.caomall.net/1536240025614144138.jpeg'; $len = $this->getUriLen($url); echo $len;exit; } fu 阅读全文
posted @ 2018-09-07 11:24 盘思动 阅读(810) 评论(0) 推荐(0)

上一页 1 ··· 4 5 6 7 8 9 10 11 12 下一页