摘要:给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 示例: GO: PHP:
阅读全文
摘要:经过线上一段时间实测,还是华为的好用。 华为: composer config -g repos.packagist composer https://repo.huaweicloud.com/repository/php/ composer config -g repo.packagist com
阅读全文
摘要:laravel app/Http/Kernel.php
阅读全文
摘要:unable to bind listening socket for address '127.0.0.1:9090': Address already in use (98) php-fpm 启动错误 9090 端口被占用,所以查看端口被谁占用 sudo netstat -lntup | gre
阅读全文
摘要:转载来自第七星尘的技术博客的《PHP使用swoole来实现实时异步任务队列》 关于异步任务队列 用户打开了我们的网站。他要做的就是勾选需要发邮件的代理商列表,然后把结算邮件发出去。假如我们需要发1封邮件,我们写个函数执行即可。考虑到网络可能会稍微有点延迟,但是是可以接受的,用户会乖乖等你的网页发完邮
阅读全文
摘要:$redis = new \Redis(); $redis->connect('127.0.0.1', 6379); $list = M('Sms')->field('phone')->where(array('s'=>0))->select(); ; for ($i=0; $i lpush('list',$list[$i]['phone']);...
阅读全文
摘要:function getRev($str,$encoding='utf-8'){ $result = ''; $len = mb_strlen($str); for($i=$len-1; $i>=0; $i--){ $result .= mb_substr($str,$i,1,$encoding); } ...
阅读全文
摘要://字符串截取 function utf8_substr($str, $start, $length) { $i = 0; //完整排除之前的UTF8字符 while($i < $start) { $ord = ord($str{$i}); if($ord < 192) { $i++; } elsei...
阅读全文
摘要://数组转对象 function array2object($array) { if (is_array($array)) { $obj = new StdClass(); foreach ($array as $key => $val){ $obj->$key = $val; } } else { ...
阅读全文
摘要:function strFilter($str){ $str = str_replace('`', '', $str); $str = str_replace('·', '', $str); $str = str_replace('~', '', $str); $str = str_replace('!', '', $str); $str = str_re...
阅读全文
摘要:PHP去除重复的数组数据 "green","", "red","b" => "green", "","blue", "red","c" => "witer","hello","witer"); //$result = array_unique($input); //去除重复元素 $result = a_array_unique($input);
阅读全文
摘要:<?php function aa($str) { $temp = array(); for ($i = 0; $i < strlen($str); $i++) { $t = $str[$i]; switch ($t) { case '(': array_push($temp, '('); ...
阅读全文
摘要:以上代码用来获取操作后的json 数据,传递给后台,进行数据排序处理。 以下为我的操作:
阅读全文
摘要:转载自51CTO 开发频道 1、图像基本处理:http://developer.51cto.com/art/201611/520928.htm 2、图像特效处理模块:http://developer.51cto.com/art/201611/520930.htm 3、图像属性处理:http://de
阅读全文
摘要:try catch 比较坑,默认这样是走TP 的错误模板页面 自定义的话:
阅读全文
摘要:$dst_path = './1.png'; $font_file = './ADOBEHEITISTD-REGULAR (V5.010).OTF'; $img_bg = imagecreatefrompng($dst_path); //打开图片, $bg_width = imagesx($img_bg); $clr = ImageColorAllocate($img_bg, 0xFF,0xFF...
阅读全文
摘要:每周: select count(*) as cnt,week(editdate) as weekflg from projects where year(editdate)=2007 group by weekflg 每月: select count(*) as cnt,month(editdat
阅读全文
摘要:IAP支付有个漏洞,用户使用的可能是IAP Free 或者俄罗斯破解什么的,所产生的交易号:170000029449420 product_id:com.zeptolab.ctrbonus.superpower1 忽略了除了去Appstore验证receipt 还需要验证product_id 并且交
阅读全文
摘要:类文件打包下载: https://pan.baidu.com/s/1slH1VEt
阅读全文
摘要:二维码类下载地址https://pan.baidu.com/s/1c2zB5D2
阅读全文