永不停更,若是以爲好請留下一個star!
Github:https://github.com/VikinDev/v-collectphp
vcollect
是一個PHP C Extension,提供流暢、便利的數組數據操做。git
定位於PHP下的ext目錄,執行github
git clone https://github.com/VikinDev/v-collect.git
在擴展目錄內,執行數組
phpize ./configure make && make install
在php.ini文件中加入extension = vcollect.so
bash
$test = vcollect([1, 2, 3, 4, 5, 6]);
^_^ | ^_^ | ^_^ | ^_^ | ^_^ | ^_^ | ^_^ | ^_^ | ^_^ | ^_^ |
---|---|---|---|---|---|---|---|---|---|
map | collapse | avg | has | mx | mi | toJson | toArray | take | pluck |
where | ......更多方法將後續更新 |
快速過濾或篩選集合spa
$vcollect = vcollect([ ['developer' => ['name' => 'Taylor', 'option' => ['test' => 'one'] ] ], ['developer' => ['name' => 'Abigail', 'option' => ['test' => 'two'] ] ] ]); $vcollect->where('developer.option.test', 'one')->toArray(); // ['developer' => ['name' => 'Taylor', 'option' => ['test' => 'one'] ] ]
永不停更,若是以爲好請留下一個star!
Github:https://github.com/VikinDev/v-collectcode