V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  Littlesqx  ›  全部回复第 1 页 / 共 1 页
回复总数  4
2020-08-31 12:23:42 +08:00
回复了 jrotty 创建的主题 PHP PHP 关于随机打乱部分数组顺序
```PHP
$all = [
['name'=>'zhangsan0', 'score'=>'90'],
['name'=>'zhangsan1', 'score'=>'89'],
['name'=>'zhangsan2', 'score'=>'89'],
['name'=>'zhangsan3', 'score'=>'70'],
['name'=>'zhangsan4', 'score'=>'89'],
];

usort($all, function ($left, $right) {
if ($left['score'] === $right['score']) {
return rand(-1, 1);
}

return $right['score'] <=> $left['score'];
});

return $all;

// press Ctrl+Enter to run
```
自荐,已经生产验证过;自定义监控支持,多进程弹性扩容,支持 Swoole 协程 API https://github.com/Littlesqx/aint-queue
2020-04-19 22:17:12 +08:00
回复了 Littlesqx 创建的主题 PHP Ain't Queue 1.0.0 发布,新增仪表盘,实时监控队列情况
@involvements 谢谢,已修复
2020-03-12 17:17:16 +08:00
回复了 myd 创建的主题 PHP PHP 如何捕获 Catchable fatal error?
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2949 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 13:25 · PVG 21:25 · LAX 06:25 · JFK 09:25
Developed with CodeLauncher
♥ Do have faith in what you're doing.