kozz/array-updater
Composer 安装命令:
composer require kozz/array-updater
包简介
Library allows easily update multidimensional arrays
README 文档
README
Recursive Array Updater
Update One
$source = ['this' => ['is' => ['the' => ['path' => [ 1,2,3,4,5 ]]]]]; $array = ArrayUpdater::from($source) ->node('this')->node('is')->node('the')->node('path')->all() ->replace(1, 100); /** * $array = ['this' => ['is' => ['the' => ['path' => [ * 100,2,3,4,5 * ]]]]]; */
Update Multiple
$source = ['this' => [ ['the' => ['path' => [ 1,2,3,4,5 ]]], ['the' => ['path' => [ 1,2,3,4,5 ]]] ]]; $array = ArrayUpdater::from($array) ->node('this')->all()->node('the')->node('path')->all() ->replaceAssoc([1=>100, 3=>300]); /** * * $array = ['this' => [ * ['the' => ['path' => [ * 100,2,300,4,5 * ]]], * ['the' => ['path' => [ * 100,2,300,4,5 * ]]] * ]]; */ *
统计信息
- 总下载量: 5.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-26