clarence/matrix
Composer 安装命令:
composer require clarence/matrix
包简介
Matrix -- a simple way to write fluent codes handing 2D data -- handling array of array is so easy!
README 文档
README
Matrix - yet another tool for operating arrays, especially two-dimensional arrays.
Usage
Provided a data source containing two columns - productId and productName, if only rows whose productId is bigger than 5 are needed, and if a key-value structure (key is productName) is needed, it can be solved like this:
$data = Matrix::from($dataSource)
->select(array('productId' => 'id', 'productName'))
->where(function ($row) {
return $row['id'] > 5;
})
->orderBy('id', SORT_DESC)
->indexedBy('productName')
->toArray();
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-25