摘要:转载来自第七星尘的技术博客的《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...
阅读全文
摘要:Git 1、创建远程分支(git项目已在) git checkout -b cgy git add . git commit -m “add new branch” git push origin cgy:cgy //创建远程分支cgy 2、合并远程分支cgy 到master主干 git push
阅读全文
摘要:PHP去除重复的数组数据 "green","", "red","b" => "green", "","blue", "red","c" => "witer","hello","witer"); //$result = array_unique($input); //去除重复元素 $result = a_array_unique($input);
阅读全文
摘要:#手下下载tar.gz包#首先手工建立mysql用户和用户组 > groupadd mysql > useradd -r -g mysql mysql#然后就是安装的解压 编译安装 > tar zxvf mysql-5.6.10.tar.gz > cd mysql-5.6.10 > cmake .
阅读全文
摘要:<?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
阅读全文