Littlesqx's recent timeline updates
Littlesqx

Littlesqx

V2EX member #414852, joined on 2019-05-23 09:05:51 +08:00
Littlesqx's recent replies
Aug 31, 2020
Replied to a topic by 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
@involvements 谢谢,已修复
Mar 12, 2020
Replied to a topic by myd PHP PHP 如何捕获 Catchable fatal error?
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3697 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 04:44 · PVG 12:44 · LAX 21:44 · JFK 00:44
♥ Do have faith in what you're doing.