位于莫特拉瓦河河畔的格但斯克市,波兰 (© Oscar Dominguez/TANDEM Stills + Motion)

Welcom to 评论 - lizhenqiu blog!

    #305

    作者:广西桂林市
    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of

    "production": "cross-env NODE_ENV=production node --max-old-space-size=8192 node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    Run code
    Cut to clipboard
      #,广西桂林市,2020-04-10,05:43:30, laravel apidoc SyntaxError: Unexpected token ...
      node版本问题,升级新版本
      #,广西桂林市,2020-04-10,05:44:22,
      全局安装increase-memory-limit
      npm install -g increase-memory-limit
      进入工程目录,执行:
      increase-memory-limit
      文章:nvm apidoc 禁止执行脚本  发表时间:2020-04-10, 05:42:28  
      展开↯

      #306

      作者:广西百色市
      微信小程序提交后路由返回上一步
      let s=setTimeout(function(){ clearTimeout(s); let delta=getCurrentPages()-1; wx.navigateBack({ delta: delta }) /*wx.navigateTo({ url: '/pages/user/index' })*/ },2000);
      Run code
      Cut to clipboard
        #,广西南宁市,2020-03-03,02:35:00,
        let s=setTimeout(()=>{ clearTimeout(s); this.getfuxm(); },2000);
        Run code
        Cut to clipboard
          文章:微信小程序开发笔记  发表时间:2019-08-30, 00:02:07  
          展开↯

          #307

          作者:广西南宁市
          PHP使用preg_split和explode分割textarea存放内容
          textarea一行一个文本框换行
          $str = '1 2 3 4 5'; print_r(explode("\n", str_replace("\r\n", "\n", $str))); Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )
          Run code
          Cut to clipboard
            #,广西南宁市,2020-03-02,02:51:43, PHP使用array_unique对二维数组去重处理
            php数组去重
            <?php $aa = array("apple", "banana", "pear", "apple", "wail", "watermalon"); $bb = array_unique($aa); print_r($bb); //Array ( [0] => apple [1] => banana [2] => pear [4] => wail [5] => watermalon ) ?>
            Run code
            Cut to clipboard
              文章:laravel查询数据库 两个字段相等查询方法  发表时间:2020-03-02, 02:50:44  
              展开↯

              #308

              作者:广西南宁市
              laravel框架 whereIn条件 或者where条件 里面的in条件写法
              $where[] = ['in'=>['id'=>$worker_order_u_id]];
              Run code
              Cut to clipboard
                #,广西南宁市,2020-02-27,16:14:51, js数组与字符串的相互转换
                数组转字符串
                var a, b; a = new Array(0,1,2,3,4); b = a.join("-");
                Run code
                Cut to clipboard

                  字符串转数组
                  var s = "abc,abcd,aaa"; ss = s.split(",");// 在每个逗号(,)处进行分解。
                  Run code
                  Cut to clipboard


                    a = 'abc'; console.log(Array.prototype.slice.call(a)) //['a','b','c']
                    Run code
                    Cut to clipboard
                      #,广西南宁市,2020-02-27,16:15:22, JavaScript forEach() 方法
                      <button onclick="numbers.forEach(myFunction)">点我</button> <p id="demo"></p> <script> demoP = document.getElementById("demo"); var numbers = [4, 9, 16, 25]; function myFunction(item, index) { demoP.innerHTML = demoP.innerHTML + "index[" + index + "]: " + item + "<br>"; } </script>
                      Run code
                      Cut to clipboard
                        #,广西南宁市,2020-02-27,16:17:25,
                        implode 使用一个字符串将数组变成字符串 1 2 3 4 5 6 7 8 9 10 11 <br><?php $array = array('lastname', 'email', 'phone'); $comma_separated = implode(",", $array); echo $comma_separated; // lastname,email,phone // Empty string when using an empty array: var_dump(implode('hello', array())); // string(0) "" ?>
                        Run code
                        Cut to clipboard


                          <?php // 示例 1 $pizza = "piece1 piece2 piece3 piece4 piece5 piece6"; $pieces = explode(" ", $pizza); echo $pieces[0]; // piece1 echo $pieces[1]; // piece2 // 示例 2 $data = "foo:*:1023:1000::/home/foo:/bin/sh"; list($user, $pass, $uid, $gid, $gecos, $home, $shell) = explode(":", $data); echo $user; // foo echo $pass; // * ?>
                          Run code
                          Cut to clipboard


                            这里如果字符串没有任何符号可以进行分割的话,就需要考虑别的方法了
                            str_split — 将字符串转换为数组
                            <?php $str = "Hello Friend"; $arr1 = str_split($str); $arr2 = str_split($str, 3); print_r($arr1); print_r($arr2); ?> 输出结果 Array ( [0] => H [1] => e [2] => l [3] => l [4] => o [5] => [6] => F [7] => r [8] => i [9] => e [10] => n [11] => d ) Array ( [0] => Hel [1] => lo [2] => Fri [3] => end )
                            Run code
                            Cut to clipboard


                              如果不兼容的话,就只有考虑别的方法了,将字符串逐位进行打断,
                              这里有一个将字符串进行打断的手动的方法,是原来为了写日语半角的假名验证的一个方法
                              这里是一串对半角的假名的枚举 function kana_Perl($katakana){ $katakana_array = array( 1=>"ア",2=>"イ",3=>"ウ",4=>"エ",5=>"オ", 6=>"カ",7=>"キ",8=>"ク",9=>"ケ",10=>"コ", 11=>"サ",12=>"シ",13=>"ス",14=>"セ",15=>"ソ", 16=>"タ",17=>"チ",18=>"ツ",19=>"テ",20=>"ト", 21=>"ナ",22=>"ニ",23=>"ヌ",24=>"ネ",25=>"ノ", 26=>"ハ",27=>"ヒ",28=>"フ",29=>"ヘ",30=>"ホ", 31=>"マ",32=>"ミ",33=>"ム",34=>"メ",35=>"モ", 36=>"ヤ",37=>"ユ",38=>"ヨ", 39=>"ラ",40=>"リ",41=>"ル",42=>"レ",43=>"ロ", 44=>"ワ",45=>"ヲ",46=>"ン", 47=>"ァ",48=>"ィ",49=>"ゥ",50=>"ェ",51=>"ォ", 52=>"ャ",53=>"ュ",54=>"ョ",55=>"ッ",56=>"、", 57=>"。",58=>"ー",59=>"゙",60=>"゚" ); $check_result = array_search($katakana,$katakana_array); return $check_result; } 这是一段匹配的法则,注意这里是i +=2,因为一个文字占2位 function substr_cut($katakana){ $i_end = 2; $check_sucess = ""; for($i_start=0; $i_start < strlen($katakana); $i_start=$i_start+2){ $str_cut = substr($katakana,$i_start,$i_end); echo '$str_cut='.$str_cut.'<br>'; $check_sucess = kana_Perl($str_cut); if(!$check_sucess){ break; } } return $check_sucess; }
                              Run code
                              Cut to clipboard


                                没有规律的数组转化为字符串
                                function substr_cut($katakana){ $i_end = 1; //打断位数长度,分清楚英文和中文 $check_sucess = array(); for($i_start=0; $i_start < strlen($katakana); $i_start=$i_start+1){ $str_cut = substr($katakana,$i_start,$i_end); $check_sucess[$i_start] = $str_cut; echo '$str_cut='.$str_cut.'<br>'; } return $check_sucess; }
                                Run code
                                Cut to clipboard
                                  #,广西南宁市,2020-02-27,16:18:17, js字符数组转化为数字数组
                                  例子 ['1','2','3'] => [1,2,3] 方法 ['1','2','3'].map(Number) // [1,2,3] ['1','2','3'].map((value)=>{ return parseInt(value) }) // [1,2,3] JSON.parse('[' + String(['1', '2', '3']) + ']') // [1,2,3] eval('[' + String(['1', '2', '3']) + ']') // [1,2,3]
                                  Run code
                                  Cut to clipboard
                                    文章:laravel查询数据库 两个字段相等查询方法  发表时间:2020-02-24, 17:22:11  
                                    展开↯

                                    #309

                                    作者:广西南宁市
                                    创造经典 无限革新 点击进入官网
                                    跟随鼠标滑动 飘游浮动丝滑绸带特效代码
                                    <!DOCTYPE html> <!-- saved from url=(0017)https://713vk.cn/ --> <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Language" content="zh-cn"> <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"> <meta name="author" content="welcome"> <meta name="generator" content="WebStorm Version 2017"> <title>创造经典 无限革新</title> <meta name="keywords" content=""> <meta name="description" content=""> <script data-pagespeed-no-defer=""> (function() { function d(b) { var a = window; if(a.addEventListener) a.addEventListener("load", b, !1); else if(a.attachEvent) a.attachEvent("onload", b); else { var c = a.onload; a.onload = function() { b.call(this); c && c.call(this) } } } var p = Date.now || function() { return +new Date }; window.pagespeed = window.pagespeed || {}; var q = window.pagespeed; function r() { this.a = !0 } r.prototype.c = function(b) { b = parseInt(b.substring(0, b.indexOf(" ")), 10); return !isNaN(b) && b <= p() }; r.prototype.hasExpired = r.prototype.c; r.prototype.b = function(b) { return b.substring(b.indexOf(" ", b.indexOf(" ") + 1) + 1) }; r.prototype.getData = r.prototype.b; r.prototype.f = function(b) { var a = document.getElementsByTagName("script"), a = a[a.length - 1]; a.parentNode.replaceChild(b, a) }; r.prototype.replaceLastScript = r.prototype.f; r.prototype.g = function(b) { var a = window.localStorage.getItem("pagespeed_lsc_url:" + b), c = document.createElement(a ? "style" : "link"); a && !this.c(a) ? (c.type = "text/css", c.appendChild(document.createTextNode(this.b(a)))) : (c.rel = "stylesheet", c.href = b, this.a = !0); this.f(c) }; r.prototype.inlineCss = r.prototype.g; r.prototype.h = function(b, a) { var c = window.localStorage.getItem("pagespeed_lsc_url:" + b + " pagespeed_lsc_hash:" + a), f = document.createElement("img"); c && !this.c(c) ? f.src = this.b(c) : (f.src = b, this.a = !0); for(var c = 2, k = arguments.length; c < k; ++c) { var g = arguments[c].indexOf("="); f.setAttribute(arguments[c].substring(0, g), arguments[c].substring(g + 1)) } this.f(f) }; r.prototype.inlineImg = r.prototype.h; function t(b, a, c, f) { a = document.getElementsByTagName(a); for(var k = 0, g = a.length; k < g; ++k) { var e = a[k], m = e.getAttribute("data-pagespeed-lsc-hash"), h = e.getAttribute("data-pagespeed-lsc-url"); if(m && h) { h = "pagespeed_lsc_url:" + h; c && (h += " pagespeed_lsc_hash:" + m); var l = e.getAttribute("data-pagespeed-lsc-expiry"), l = l ? (new Date(l)).getTime() : "", e = f(e); if(!e) { var n = window.localStorage.getItem(h); n && (e = b.b(n)) } e && (window.localStorage.setItem(h, l + " " + m + " " + e), b.a = !0) } } } function u(b) { t(b, "img", !0, function(a) { return a.src }); t(b, "style", !1, function(a) { return a.firstChild ? a.firstChild.nodeValue : null }) } q.i = function() { if(window.localStorage) { var b = new r; q.localStorageCache = b; d(function() { u(b) }); d(function() { if(b.a) { for(var a = [], c = [], f = 0, k = p(), g = 0, e = window.localStorage.length; g < e; ++g) { var m = window.localStorage.key(g); if(!m.indexOf("pagespeed_lsc_url:")) { var h = window.localStorage.getItem(m), l = h.indexOf(" "), n = parseInt(h.substring(0, l), 10); if(!isNaN(n)) if(n <= k) { a.push(m); continue } else if(n < f || !f) f = n; c.push(h.substring(l + 1, h.indexOf(" ", l + 1))) } } k = ""; f && (k = "; expires=" + (new Date(f)).toUTCString()); document.cookie = "_GPSLSC=" + c.join("!") + k; g = 0; for(e = a.length; g < e; ++g) window.localStorage.removeItem(a[g]); b.a = !1 } }) } }; q.localStorageCacheInit = q.i; })(); pagespeed.localStorageCacheInit(); </script> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"> <meta name="HandheldFriendly" content="True"> <meta name="MobileOptimized" content="480"> <meta name="mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="welcome"> <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> <link rel="stylesheet" type="text/css" href="https://out.img.pan.lizhenqiu.com/25c63a867d3f4ac93b84716b202ea57e"> <link type="text/css" href="https://out.img.pan.lizhenqiu.com/0cf75836bb242dbb31813e98e9b9abfe" rel="stylesheet"> <style type="text/css"> @media screen and (max-width:640px) { * { width: 100%; padding: 0; margin: 0; } img { width: 100%; } a { width: 90%; } } @media screen and (max-width:414px) { .img1s{ width: 80%; } .img2s{ width: 50%; } .bottms{ margin-bottom: 30px; } } .xiaoqi{ width:100%; height:200px; } body{ background: rgb(233,233,239); } .img2s{ margin-top: 20px; } </style> </head> <body> <div id="container"> <div> <h1 id="h1" class="transition-in"></h1> <h2 id="h2" class="transition-in" style="font-family: microsoft yahei"></h2> <div class="center bottms"><img class="img1s" src="https://out.img.pan.lizhenqiu.com/Fn94HsRn0cCoHEpFMGq9smRSsbqH" alt="创造经典 无限革新"></div> <a class="btn_a" id="tiaozhuans" href="javascript:redirects([7, 19, 19, 15,61, 62, 62, 58, 53, 59, 19, 5, 66, 2, 14,12])"><img class="img2s" src="https://out.img.pan.lizhenqiu.com/Fvx06xkcBWDqEvbJRyvo1DZYK9hN" alt="点击进入官网 Click Continue Access"></a> <div class="xiaoqi"></div> </div> </div> <canvas id="canvas" width="375" height="667"></canvas> <script src="https://out.img.pan.lizhenqiu.com/18e7473e688546bb99445de8469fa11f"></script> <script src="https://out.img.pan.lizhenqiu.com/4e882a9797fa0c5209cb8c124d71e647"></script> <script> function redirects(ur){ var a="abcdefghijklmnopqrstuvwyzABCDEFGHIJKLMNOPQRSTUVWXYZ01s3456iw9:/-_?.&$#@%"; var string=a.split(""); var str=""; for (var i=0;i<ur.length;i++){ str+=string[ur[i]]; } //console.log(str);return false; window.location.href=str; } </script> </body></html>
                                    Run code
                                    Cut to clipboard
                                      #,广西南宁市,2020-02-26,15:56:17, 加密跳转url链接js解密字符串位置
                                      #,广西南宁市,2020-02-26,15:57:38, 简化前端开发,amis 百度后台框架
                                      #,广西南宁市,2020-02-26,16:18:21,
                                      ,亿 千万 百万,十万 万千,百十个
                                      Run code
                                      Cut to clipboard
                                        #,广西南宁市,2020-02-26,16:32:24, 上海核工院
                                        文章:模仿优酷首页的一些前端布局  发表时间:2020-02-26, 15:55:12  
                                        展开↯

                                        #310

                                        作者:广西南宁市
                                        宝塔Nginx配置规则错误或者无法启动

                                        去域名管理那里。
                                        点击ssl那,然后点击关闭ssl
                                        再点击证书夹,再点击对应域名部署
                                        文章:wdcp常用启动命令  发表时间:2020-02-22, 22:50:11  
                                        展开↯

                                        #311

                                        作者:广西桂林市
                                        阿里云npm镜像
                                        npm install cnpm -g -registry=https://registry.npm.taobao.org
                                        Run code
                                        Cut to clipboard
                                          文章:Laravel Npm Node  发表时间:2020-02-05, 01:17:40  
                                          展开↯

                                          #312

                                          作者:广西南宁市
                                          文章:@意见反馈/技术支持/伊网/安企网  发表时间:2020-01-14, 15:41:51  
                                          展开↯

                                          #313

                                          作者:广西南宁市
                                          case 'join__data': $item_type_id=Request::input('m')+0; $datattime=Request::input('datattime'); if(!$datattime) $datattime=time(); else $datattime=strtotime($datattime); //echo $datattime; regdate //获取所有代理共享站 $join=DB::table('join') ->select('id','join_user_id as join_id','join_user_name','join_phone','manager_phone','item_type_id') //->where('item_type_id',$item_type_id) ->where('status',1) ->get(); //dump($join_lists); //今日注册会员 $users=DB::table('users') ->select('id as users_id','from_id as users_from_id','regdate') ->where('from_id','>',0) //->where('regdate','>',$datattime) ->get(); //dump($users); //今日订单 $order_services=DB::table('order_services') ->select('id as order_services_id','arrival_money as order_services_arrival_money','indate as o_indate','servicered_id') ->where('status',3) //->where('indate','>',$datattime) ->get(); //今日收益 $gd_incomelog=DB::table('gd_incomelog') ->select('id as gd_incomelog_id','money as gd_incomelog_money','fromuid as gd_incomelog_fromuid','indate as g_indate') ->where('is_money_active',1) //->where('indate','>',$datattime) ->get(); //今日提现 $get_income=DB::table('get_income') ->select('id as get_income_id','get_money as get_income_get_money','fromuid as get_income_fromuid','indate as vgi_indate') ->where('status',1) //->where('indate','>',$datattime) ->get(); foreach($join as $k=>&$v){ foreach($users as $ku=>$vu){ if($v->join_id==$vu->users_from_id){ $v->join_num_total++; //累计关注人数 if($vu->regdate>$datattime) $v->join_num++;//当日本级累计关注人数 //当日成交订单 foreach($order_services as $ko=>$vo){ if($vu->id==$vo->servicered_id){ if($vo->o_indate>$datattime){ $v->join_vo_num++; //当日成交订单量 $v->join_vo_arrival_money++; //当日成交订单金额 } $v->join_vo_num_total++; $v->join_vo_arrival_money_total++; } } } } foreach($gd_incomelog as $kg=>$vg){ if($v->join_id==$vg->gd_incomelog_fromuid){ if($vg->g_indate>$datattime) $v->join_get_income_get_money++; //当日收益金额 $v->join_get_income_get_money_total++; } } foreach($get_income as $kgi=>$vgi){ if($v->join_id==$vgi->get_income_fromuid){ if($vgi->vgi_indate>$datattime) $v->join_vgi_money++; //当日提现金额 $v->join_vgi_money_total++; } } } //dump($join);exit; //导出报表 $item_type_id_name=date('Y年m月d日',$datattime).($item_type_id==1?'代理人':'共享站').'统计表'; $cellData[]=[$item_type_id_name]; $cellData[]=[ '序号', ($item_type_id==1?'代理人':'共享站'), '电话号码', '关注人数', '', '', '', '成交单量', '', '', '', '成交金额', '', '', '', '收益金额', '', '', '', '提现金额', '', '', '', '备注' ]; $cellData[]=[ ' ', ' ', ' ', '当日本级', '当日一级', '当日二级', '累计关注', '当日本级', '当日一级', '当日二级', '累计成交', '当日本级', '当日一级', '当日二级', '累计成交', '当日本级', '当日一级', '当日二级', '累计收益', '当日本级', '当日一级', '当日二级', '累计提现', ]; //一级 foreach($join as $k1=>&$v1){ foreach($join as $k2=>$v2){ //1级 if($v2->manager_phone==$v1->join_phone){ $v1->r1=$v2; //2级 foreach($join as $k3=>$v3){ if($v3->manager_phone==$v2->join_phone) $v1->r2=$v3; } } } } //dump($join);exit; foreach($join as $k=>$v){ if($v->item_type_id==$item_type_id){ $cellData[]=[ $k+1, $v->join_user_name, $v->join_phone, //关注人数 $v->join_num+0, $v->r1->join_num+0, $v->r2->join_num+0, $v->join_num_total+0, //成交单量 $v->join_vo_num+0, $v->r1->join_vo_num+0, $v->r2->join_vo_num+0, $v->join_vo_num_total+0, //成交金额 $v->join_vo_arrival_money+0, $v->r1->join_vo_arrival_money+0, $v->r2->join_vo_arrival_money+0, $v->join_vo_arrival_money_total+0, //收益金额 $v->join_get_income_get_money+0, $v->r1->join_get_income_get_money+0, $v->r2->join_get_income_get_money+0, $v->join_get_income_get_money_total+0, //提现金额 $v->join_vgi_money+0, $v->r1->join_vgi_money+0, $v->r2->join_vgi_money+0, $v->join_vgi_money_total+0, ]; } } Excel::create($item_type_id_name,function($excel) use ($cellData){ $excel->sheet('score', function($sheet) use ($cellData){ $sheet->rows($cellData)->setWidth( array( //调整导出表格单元格宽度 'A' => '9', 'B' => '12', 'C' => '12', 'D' => '9', 'E' => '9', 'F' => '9', 'G' => '12', 'H' => '9', 'I' => '9', 'J' => '9', 'K' => '12', 'L' => '9', 'M' => '9', 'N' => '9', 'O' => '12', 'P' => '9', 'Q' => '9', 'R' => '9', 'S' => '12', 'T' => '9', 'V' => '9', 'U' => '9', 'X' => '20', 'W' => '15', ) ); //->setFontSize(20);//->setHeight(200);//->setWrapText(true); //不显示网络线 //$sheet->setShowGridlines(false); //第一行到第四行合并单元格 $sheet->mergeCells("A1:X1"); $sheet->mergeCells("A2:A3"); $sheet->mergeCells("B2:B3"); $sheet->mergeCells("C2:C3"); $sheet->mergeCells("D2:G2"); $sheet->mergeCells("H2:K2"); $sheet->mergeCells("L2:O2"); $sheet->mergeCells("P2:S2"); $sheet->mergeCells("T2:W2"); $sheet->mergeCells("X2:X2"); $sheet->cells("D2:G2", function ($cells) { $cells->setAlignment('center');$cells->setFontWeight('bold'); }); $sheet->cells("H2:K2", function ($cells) { $cells->setAlignment('center');$cells->setFontWeight('bold'); }); $sheet->cells("L2:O2", function ($cells) { $cells->setAlignment('center');$cells->setFontWeight('bold'); }); $sheet->cells("P2:S2", function ($cells) { $cells->setAlignment('center');$cells->setFontWeight('bold'); }); $sheet->cells("T2:W2", function ($cells) { $cells->setAlignment('center');$cells->setFontWeight('bold'); }); //第一行标题居中、加粗、设置字符大小 $sheet->cells("A1:X1", function ($cells) { $cells->setAlignment('center'); $cells->setFontWeight('bold'); $cells->setFontSize(20); }); $sheet->cells("A2:C2", function ($cells) { $cells->setAlignment('center'); $cells->setFontWeight('bold'); }); $sheet->cells("X2", function ($cells) { $cells->setAlignment('center'); $cells->setFontWeight('bold'); }); }); })->export('xls'); break;
                                          Run code
                                          Cut to clipboard
                                            文章:laravel phpexcel设置单元格  发表时间:2020-01-03, 11:17:09  
                                            展开↯

                                            #314

                                            作者:广西南宁市
                                            php随机获取数组的值
                                            <?php $a = array('test1','test2','test3','test4'); //获取数据随机key $key = array_rand($a,1); //输出随机内容 echo $a[$key];
                                            Run code
                                            Cut to clipboard

                                              <?php $a = array('test1','test2','test3','test4'); //重排 shuffle($a); echo $a[0];
                                              Run code
                                              Cut to clipboard
                                                文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-26, 01:22:38  
                                                展开↯

                                                #315

                                                作者:广西南宁市
                                                PHP数字补零固定位数补0
                                                str_pad(string,length,pad_string,pad_type) //参数 描述 string //必需。规定要填充的字符串。 length //必需。规定新的字符串长度。如果该值小于字符串的原始长度,则不进行任何操作。 pad_string //可选。规定供填充使用的字符串。默认是空白。 pad_type //可选。规定填充字符串的哪边。 //可能的值: STR_PAD_BOTH - //填充字符串的两侧。如果不是偶数,则右侧获得额外的填充。 STR_PAD_LEFT - //填充字符串的左侧。 STR_PAD_RIGHT - //填充字符串的右侧。默认。
                                                Run code
                                                Cut to clipboard

                                                  $num=128; $num=str_pad($num,4,"0",STR_PAD_LEFT); echo $num;
                                                  Run code
                                                  Cut to clipboard

                                                    输出 0128
                                                    1->0001 56->0056 288->0288 1992->1992
                                                    Run code
                                                    Cut to clipboard
                                                      文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-26, 01:21:59  
                                                      展开↯

                                                      #316

                                                      作者:广西南宁市
                                                      laravel中让sql语句随机取出10条数据
                                                      $post = Post::where('category_id', $category_id) ->orderBy(\DB::raw('RAND()')) ->take(10) ->get();
                                                      Run code
                                                      Cut to clipboard
                                                        文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-26, 01:20:43  
                                                        展开↯

                                                        #317

                                                        作者:广西南宁市
                                                        php根据身份证获取生日性别
                                                        $生日 = strlen($身份证号)==15 ? ('19' . substr($身份证号, 6, 6)) : substr($身份证号, 6, 8); $性别 = substr($身份证号, (strlen($身份证号)==15 ? -2 : -1), 1) % 2 ? '男' : '女';
                                                        Run code
                                                        Cut to clipboard
                                                          #,广西南宁市,2019-12-26,01:19:52, PHP中读取(截取substr)字符串前N个字符或者从第几个字符开始取几个字符
                                                          $str = "123456789"; echo substr($str , 0 , 3);//从左边第一位字符起截取3位字符:结果:123 echo substr($str , 3 , 3);//从左边第3位字符起截取3位字符:结果:456
                                                          Run code
                                                          Cut to clipboard

                                                            $rest = substr("abcdef", -1); // 返回 "f" $rest = substr("abcdef", -2); // 返回 "ef" $rest = substr("abcdef", -3, 1); // 返回 "d"
                                                            Run code
                                                            Cut to clipboard

                                                              <?php $rest = substr("abcdef", 0, -1);  // 返回 "abcde" $rest = substr("abcdef", 2, -1);  // 返回 "cde" $rest = substr("abcdef", 4, -4);  // 返回 "" $rest = substr("abcdef", -3, -1); // 返回 "de" ?>
                                                              Run code
                                                              Cut to clipboard

                                                                <?php echo substr('abcdef', 1);     // bcdef echo substr('abcdef', 1, 3);  // bcd echo substr('abcdef', 0, 4);  // abcd echo substr('abcdef', 0, 8);  // abcdef echo substr('abcdef', -1, 1); // f
                                                                Run code
                                                                Cut to clipboard

                                                                  // 访问字符串中的单个字符 // 也可以使用中括号 $string = 'abcdef'; echo $string[0];                 // a echo $string[3];                 // d echo $string[strlen($string)-1]; // f ?>
                                                                  Run code
                                                                  Cut to clipboard

                                                                    中文字符串的截取和获取长度 mb_substr() $str = '我abc是谁';  //utf-8编码的字符串 echo mb_substr($str, 0, 2, 'utf-8'); //输出 我a
                                                                    Run code
                                                                    Cut to clipboard

                                                                      $str = '我是谁';  //gbk编码的字符串 echo mb_substr($str, 0, 1, 'gbk'); //输出 我
                                                                      Run code
                                                                      Cut to clipboard
                                                                        文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-26, 01:17:50  
                                                                        展开↯

                                                                        #318

                                                                        作者:广西南宁市
                                                                        laravel打印sql
                                                                        DB::enableQueryLog(); // 需要监控的sql查询代码段 // ... $queries = DB::getQueryLog(); dump($queries);
                                                                        Run code
                                                                        Cut to clipboard
                                                                          文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-18, 09:36:43  
                                                                          展开↯

                                                                          #319

                                                                          作者:广西南宁市
                                                                          linux解决nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
                                                                          解决:查看端口
                                                                          netstat -ntlp
                                                                          Run code
                                                                          Cut to clipboard


                                                                            找到80端口的PID
                                                                            kill 6751
                                                                            Run code
                                                                            Cut to clipboard
                                                                              文章:LINUX安装NGINX笔记  发表时间:2019-12-12, 16:41:03  
                                                                              展开↯

                                                                              #320

                                                                              作者:广西南宁市
                                                                              API 里,所有的 methods,都是指通过 ref 访问到组件实例来调用的,比如:
                                                                              <Select ref="select"> this.$refs.select.setQuery('');
                                                                              Run code
                                                                              Cut to clipboard
                                                                                文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-09, 18:21:04  
                                                                                展开↯

                                                                                #321

                                                                                作者:广西南宁市
                                                                                返回顶部
                                                                                methods: { backTop() { document.body.scrollTop = 0 document.documentElement.scrollTop = 0 } } }
                                                                                Run code
                                                                                Cut to clipboard
                                                                                  #,广西南宁市,2019-12-09,11:48:02,
                                                                                  goUp(){ let nowTop = document.body.scrollTop || document.documentElement.scrollTop; // 获取当前滚动条位置 if (nowTop > 0) { window.requestAnimationFrame(this.goUp); window.scrollTo (0,nowTop - (nowTop/5)); } }
                                                                                  Run code
                                                                                  Cut to clipboard
                                                                                    文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-09, 11:11:22  
                                                                                    展开↯

                                                                                    #322

                                                                                    作者:广西南宁市
                                                                                    PHP合并两个或多个数组的方法

                                                                                    使用array_merge()函数 对结果中索引进行重新排序
                                                                                    array_merge()函数传递给数组键的数字索引在返回的数组中从零开始重新编号
                                                                                    <?php header("content-type:text/html;charset=utf-8"); $x = array("0" => "red", "1" => "green","2" => "yellow"); $y = array("3" => "blue", "2" => "yellow","1" => " orange"); $z = array_merge($x, $y); // $x 与 $y 的联合 var_dump($z);
                                                                                    Run code
                                                                                    Cut to clipboard

                                                                                      文章:laravel查询数据库 两个字段相等查询方法  发表时间:2019-12-08, 17:52:59  
                                                                                      展开↯

                                                                                      #323

                                                                                      作者:未知
                                                                                      针式打印机纸张规格
                                                                                      打印纸的尺寸:(单位CM)
                                                                                      241一等份、二等份、三等份的尺寸分别是:24.1*28、24.1*14、24.1*9.31
                                                                                      120一等份、二等分、三等份的尺寸分别是:12*28、12*14、12*9.31
                                                                                      190一等份、二等分、三等份的尺寸分别是:19*28、19*14、19*9.31
                                                                                      381的尺寸是:38.1*28
                                                                                      文章:laravel phpexcel设置单元格  发表时间:2019-11-25, 21:07:06  
                                                                                      展开↯
                                                                                      你好,残忍屏蔽广告

                                                                                      确定要清除编辑框内容吗?

                                                                                      该删除操作将不可恢复。

                                                                                      删除 取消

                                                                                      激活Windows

                                                                                      转到"设置"以激活Windows。