ustream/arr
Composer 安装命令:
composer require ustream/arr
包简介
Ustream Array helpers
README 文档
README
This is a collection of Array related utilities.
Extractors
Mining data from a deeply nested array is tedious. The Extractor library give a programable and composable solution to this kind of problems.
Reaching data on a simple "path" in the nested structure:
$sample = array( "foo" => array( "bar" => array( "baz" => "something" ) ) ); $extractor = new PathExtractor(array("foo", "bar", "baz")); $result = $extractor->extract($sample); // "something" # inside an Option instance $extractor = new PathExtractor(array("foo", "bar")); $result = $extractor->extract($sample); // array("baz" => "something") # inside an Option instance $extractor = new PathExtractor(array("foo")); $result = $extractor->extract($sample); // array("bar" => array("baz" => "something")) # inside an Option instance
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2013-10-28