{"id":15029175,"url":"https://github.com/narrowspark/arr","last_synced_at":"2025-10-04T00:30:26.663Z","repository":{"id":40395788,"uuid":"49341106","full_name":"narrowspark/arr","owner":"narrowspark","description":":shipit: A collection of utilities to manipulate arrays.","archived":true,"fork":false,"pushed_at":"2022-06-26T06:51:36.000Z","size":104,"stargazers_count":2,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T16:22:08.396Z","etag":null,"topics":["array","array-helper","array-manipulations","array-methods","dot-notation","manipulate-arrays","multi-array","php7"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/narrowspark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-09T21:00:26.000Z","updated_at":"2023-03-01T10:41:30.000Z","dependencies_parsed_at":"2022-08-18T03:05:44.805Z","dependency_job_id":null,"html_url":"https://github.com/narrowspark/arr","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/narrowspark/arr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Farr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Farr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Farr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Farr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/narrowspark","download_url":"https://codeload.github.com/narrowspark/arr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/narrowspark%2Farr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278249264,"owners_count":25955825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","array-helper","array-manipulations","array-methods","dot-notation","manipulate-arrays","multi-array","php7"],"created_at":"2024-09-24T20:09:53.421Z","updated_at":"2025-10-04T00:30:26.097Z","avatar_url":"https://github.com/narrowspark.png","language":"PHP","readme":"\nA PHP collection of utilities to manipulate arrays. Compatible with, PHP 7 and Php 7.1.\n\n[![Author](http://img.shields.io/badge/author-@anolilab-blue.svg?style=flat-square)](https://twitter.com/anolilab)\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/narrowspark/arr.svg?style=flat-square)](https://packagist.org/packages/narrowspark/arr)\n[![Total Downloads](https://img.shields.io/packagist/dt/narrowspark/arr.svg?style=flat-square)](https://packagist.org/packages/narrowspark/arr)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\n## Master\n\n[![Build Status](https://img.shields.io/travis/narrowspark/arr/master.svg?style=flat-square)](https://travis-ci.org/narrowspark/arr)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/narrowspark/arr/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/narrowspark/arr/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/narrowspark/arr/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/narrowspark/arr)\n\n## Develop\n\n[![Build Status](https://img.shields.io/travis/narrowspark/arr/develop.svg?style=flat-square)](https://travis-ci.org/narrowspark/arr)\n[![Coverage Status](https://img.shields.io/scrutinizer/coverage/g/narrowspark/arr/develop.svg?style=flat-square)](https://scrutinizer-ci.com/g/narrowspark/arr/code-structure)\n[![Quality Score](https://img.shields.io/scrutinizer/g/narrowspark/arr/develop.svg?style=flat-square)](https://scrutinizer-ci.com/g/narrowspark/arr)\n\n* [Installation](#installation)\n* [Arr](#arr)\n    * [Access methods](#access)\n        * [set](#set)\n        * [get](#get)\n        * [add](#add)\n        * [has](#has)\n        * [put](#put)\n        * [exists](#exists)\n        * [update](#update)\n        * [forget](#forget)\n    * [Enumerator](#enumerator)\n        * [random](#random)\n        * [only](only)\n        * [split](#split)\n        * [isAssoc](#isAssoc)\n        * [isIndexed](#isIndexed)\n    * [Transform](#transform)\n        * [pop](#pop)\n        * [swap](#swap)\n        * [every](#every)\n        * [combine](#combine)\n        * [collapse](#collapse)\n        * [divide](#divide)\n        * [stripEmpty](#stripEmpty)\n        * [unique](#unique)\n        * [without](#without)\n        * [reindex](#reindex)\n        * [merger](#merge)\n        * [extend](#extend)\n        * [asHierarchy](#asHierarchy)\n        * [groupBy](#groupBy)\n        * [dot](#dot)\n        * [flatten](#flatten)\n        * [expand](#expand)\n        * [reset](#reset)\n        * [extendDistinct](#extendDistinct)\n        * [sortRecursive](#sortRecursive)\n        * [zip](#zip)\n    * [Traverse](#traverse)\n        * [map](#map)\n        * [filter](#filter)\n        * [all](#all)\n        * [reject](#reject)\n        * [where](#where)\n        * [first](#first)\n        * [last](#last)\n\n## Why?\n\n## Installation\n\nVia Composer\n\n``` bash\n$ composer require narrowspark/arr\n```\n\nor\n\n``` json\n\"require\": {\n    \"narrowspark/arr\": \"~2.0\"\n}\n```\n\n## Arr\n\nAll methods listed under \"Arr\".\n\n``` php\nuse Narrowspark\\Arr\\Arr;\n\n// Returns a new array with the added key and value;\n// ['foo' =\u003e bar, 'arr' =\u003e 'narrowsaprk']\nArr::set(['foo' =\u003e bar], 'arr', 'narrowspark');\n```\n\n#### set\n\nSet an array item to a given value using \"dot\" notation. If no key is given to the method, the entire array will be replaced.\n``` php\n    $arr = Arr::set(['foo' =\u003e 'bar'], 'arr', 'narrowspark'); // ['foo' =\u003e 'bar', 'arr' =\u003e 'narrowspark']\n```\n\n#### get\n\nGet an item from an array using \"dot\" notation. If key dont exist, you get a default value back.\n\n``` php\n    $arr = Arr::get(['foo' =\u003e 'bar'], 'foo', 'narrowspark'); // bar\n```\n\n#### add\n\nAdd an element to the array at a specific location using the \"dot\" notation.\n\n``` php\n    $arr = Arr::add(['foo' =\u003e 'bar'], 'foo', 'narrowspark'); // ['foo' =\u003e ['bar', 'narrowspark']]\n```\n\n#### has\n\nCheck if an item exists in an array using \"dot\" notation.\n\n``` php\n    $arr = Arr::has(['foo' =\u003e 'bar'], 'foo'); // true\n```\n\n#### update\n\nUpdates data at the given path.\n\n``` php\n    $increment = function ($value) {\n        return $value + 1;\n    };\n\n    $arr = Arr::update(['foo' =\u003e 1], $increment); // ['foo' =\u003e 2]\n```\n\n#### forget\n\nRemove one or many array items from a given array using \"dot\" notation.\n\n``` php\n    $arr = ['foo' =\u003e 'bar']\n\n    Arr::forget($arr, 'foo');\n\n    $arr; // []\n```\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\nFrom the project directory, tests can be ran using phpunit\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Daniel Bannert](https://github.com/prisis)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Farr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnarrowspark%2Farr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnarrowspark%2Farr/lists"}