{"id":21467438,"url":"https://github.com/elusivecodes/fyrearray","last_synced_at":"2025-07-19T18:08:30.807Z","repository":{"id":62508466,"uuid":"371323402","full_name":"elusivecodes/FyreArray","owner":"elusivecodes","description":"FyreArray is a free, open-source array manipulation library for PHP.","archived":false,"fork":false,"pushed_at":"2025-07-03T09:17:21.000Z","size":134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T09:04:15.690Z","etag":null,"topics":["array","php","utility"],"latest_commit_sha":null,"homepage":"","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/elusivecodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-05-27T09:47:34.000Z","updated_at":"2025-07-03T09:17:13.000Z","dependencies_parsed_at":"2024-10-26T08:11:29.763Z","dependency_job_id":"d3afd773-b2e3-4308-8e74-1fe9526f6ed9","html_url":"https://github.com/elusivecodes/FyreArray","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/elusivecodes/FyreArray","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreArray","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreArray/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreArray/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreArray/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elusivecodes","download_url":"https://codeload.github.com/elusivecodes/FyreArray/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elusivecodes%2FFyreArray/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265982837,"owners_count":23859573,"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","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","php","utility"],"created_at":"2024-11-23T08:18:07.643Z","updated_at":"2025-07-19T18:08:30.785Z","avatar_url":"https://github.com/elusivecodes.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FyreArray\r\n\r\n**FyreArray** is a free, open-source array manipulation library for *PHP*.\r\n\r\n\r\n## Table Of Contents\r\n- [Installation](#installation)\r\n- [Methods](#methods)\r\n\r\n\r\n\r\n## Installation\r\n\r\n**Using Composer**\r\n\r\n```\r\ncomposer require fyre/array\r\n```\r\n\r\nIn PHP:\r\n\r\n```php\r\nuse Fyre\\Utility\\Arr;\r\n```\r\n\r\n\r\n## Methods\r\n\r\n**Chunk**\r\n\r\nSplit an array into chunks.\r\n\r\n- `$array` is the input array.\r\n- `$size` is a number representing the size of each chunk.\r\n- `$preserveKeys` is a boolean indicating whether the array keys will be preserved, and will default to *false*.\r\n\r\n```php\r\n$chunk = Arr::chunk($array, $size, $preserveKeys);\r\n```\r\n\r\n**Collapse**\r\n\r\nRecursively replace elements into the first array.\r\n\r\n- `$array` is the input array.\r\n\r\nAll arguments supplied to this method will be replace into the first array.\r\n\r\n```php\r\n$collapsed = Arr::collapse($array, ...$replacements);\r\n```\r\n\r\n**Column**\r\n\r\nGet the values from a single column in the input array.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the column to pull values from.\r\n\r\n```php\r\n$column = Arr::column($array, $key);\r\n```\r\n\r\n**Combine**\r\n\r\nCreate an array by using one array for keys and another for its values.\r\n\r\n- `$keys` is an array containing the keys.\r\n- `$values` is an array containing the values.\r\n\r\n```php\r\n$combined = Arr::combine($keys, $values);\r\n```\r\n\r\n**Count**\r\n\r\nCount all elements in an array.\r\n\r\n- `$array` is the input array.\r\n- `$mode` is an integer representing the counting mode, and will default to *Arr::COUNT_NORMAL*.\r\n\r\n```php\r\n$count = Arr::count($array, $mode);\r\n```\r\n\r\n**Difference**\r\n\r\nFind values in the first array not present in any of the other arrays.\r\n\r\n- `$array` is the input array.\r\n\r\nAny additional arguments supplied will be used to test for the values of the first array.\r\n\r\n```php\r\n$diff = Arr::diff($array, ...$arrays);\r\n```\r\n\r\n**Divide**\r\n\r\nSplit an array into keys and values.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$divided = Arr::divide($array);\r\n```\r\n\r\n**Dot**\r\n\r\nFlatten a multi-dimensional array using \"dot\" notation.\r\n\r\n- `$array` is the input array.\r\n- `$prefix` is a string representing the key prefix, and will default to *null*.\r\n\r\n```php\r\n$dot = Arr::dot($array, $prefix);\r\n```\r\n\r\n**Every**\r\n\r\nDetermine whether every element in an array passes a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$every = Arr::every($array, $callback);\r\n```\r\n\r\n**Except**\r\n\r\nFilter an array without the specified key/value pairs.\r\n\r\n- `$array` is the input array.\r\n- `$keys` is an array containing the keys to remove.\r\n\r\n```php\r\n$except = Arr::except($array, $keys);\r\n```\r\n\r\n**Fill**\r\n\r\nFill an array with values.\r\n\r\n- `$amount` is a number representing the number of elements to insert.\r\n- `$value` is the value to insert.\r\n\r\n```php\r\n$filled = Arr::fill($amount, $value);\r\n```\r\n\r\n**Filter**\r\n\r\nFilter elements of an array using a callback function.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n- `$mode` is a number determining representing which arguments will be sent to the callback, and will default to *Arr::FILTER_BOTH*.\r\n\r\nIf `$callback` is omitted this function will filter empty elements from the array.\r\n\r\n```php\r\n$filtered = Arr::filter($array, $callback);\r\n```\r\n\r\n**Find**\r\n\r\nFind the first value in an array that satisfies a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n- `$default` is the default value to return, and will default to *null*.\r\n\r\n```php\r\n$find = Arr::find($array, $callback, $default);\r\n```\r\n\r\n**Find Key**\r\n\r\nFind the first key in an array that satisfies a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$findKey = Arr::findKey($array, $callback);\r\n```\r\n\r\n**Find Last**\r\n\r\nFind the last value in an array that satisfies a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n- `$default` is the default value to return.\r\n\r\n```php\r\n$findLast = Arr::findLast($array, $callback, $default);\r\n```\r\n\r\n**Find Last Key**\r\n\r\nFind the last key in an array that satisfies a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$findLastKey = Arr::findLastKey($array, $callback);\r\n```\r\n\r\n**Flatten**\r\n\r\nFlatten a multi-dimensional array into a single level.\r\n\r\n- `$array` is the input array.\r\n- `$maxDepth` is a number representing the maximum depth to flatten, and will default to *1*.\r\n\r\n```php\r\n$flattened = Arr::flatten($array, $maxDepth);\r\n```\r\n\r\n**Forget Dot**\r\n\r\nRemove a key/value pair using \"dot\" notation.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the key to remove.\r\n\r\n```php\r\n$forgetDot = Arr::forgetDot($array, $key);\r\n```\r\n\r\n**Get Dot**\r\n\r\nRetrieve a value using \"dot\" notation.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the key to lookup.\r\n- `$defaultValue` is the default value to return, and will default to *null*.\r\n\r\n```php\r\n$getDot = Arr::getDot($array, $key, $defaultValue);\r\n```\r\n\r\n**Has Dot**\r\n\r\nDetermine whether a given element exists in an array using \"dot\" notation.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the key to check for.\r\n\r\n```php\r\n$hasDot = Arr::hasDot($array, $key);\r\n```\r\n\r\n**Has Key**\r\n\r\nDetermine whether a given key exists in an array.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the key to check for.\r\n\r\n```php\r\n$hasKey = Arr::hasKey($array, $key);\r\n```\r\n\r\n**Includes**\r\n\r\nDetermine whether a given value exists in an array.\r\n\r\n- `$array` is the input array.\r\n- `$value` is the value to check for.\r\n\r\n```php\r\n$includes = Arr::includes($array, $value);\r\n```\r\n\r\n**Index**\r\n\r\nIndex a multi-dimensional array using a given key value.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the column to pull key values from.\r\n\r\n```php\r\n$index = Arr::index($array, $key);\r\n```\r\n\r\n**Index Of**\r\n\r\nSearch an array for a given value and returns the first key.\r\n\r\n- `$array` is the input array.\r\n- `$value` is the value to search for.\r\n- `$strict` is a boolean indicating whether a strict search will be performed, and will default to *false*.\r\n\r\n```php\r\n$indexOf = Arr::indexOf($array, $value, $strict);\r\n```\r\n\r\n**Intersect**\r\n\r\nFind values in the first array present in all of the other arrays.\r\n\r\n- `$array` is the input array.\r\n\r\nAll additional arguments supplied will be used to test for intersections.\r\n\r\n```php\r\n$intersect = Arr::intersect($array, ...$arrays);\r\n```\r\n\r\n**Is Array**\r\n\r\nDetermine whether the value is an array.\r\n\r\n- `$value` is the value to test.\r\n\r\n```php\r\n$isArray = Arr::isArray($value);\r\n```\r\n\r\n**Is List**\r\n\r\nDetermine whether an array has consecutive keys starting from 0.\r\n\r\n- `$array` is the array to test.\r\n\r\n```php\r\n$isList = Arr::isList($array);\r\n```\r\n\r\n**Join**\r\n\r\nJoin an array elements using a specified separator.\r\n\r\n- `$array` is the input array.\r\n- `$separator` is a string representing the separator to join with, and will default to *\",\"*\r\n\r\n```php\r\n$joined = Arr::join($array, $separator);\r\n```\r\n\r\n**Keys**\r\n\r\nGet all keys of an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$keys = Arr::keys($array);\r\n```\r\n\r\n**Last Index Of**\r\n\r\nSearch an array for a given value and returns the last key.\r\n\r\n- `$array` is the input array.\r\n- `$value` is the value to search for.\r\n- `$strict` is a boolean indicating whether a strict search will be performed, and will default to *false*.\r\n\r\n```php\r\n$lastIndexOf = Arr::lastIndexOf($array, $value, $strict);\r\n```\r\n\r\n**Map**\r\n\r\nApply a callback to the elements of an array.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$map = Arr::map($array, $callback);\r\n```\r\n\r\n**Merge**\r\n\r\nMerge one or more arrays.\r\n\r\n- `$array` is the input array.\r\n\r\nAll additional arguments supplied will be merged with the first array.\r\n\r\n```php\r\n$merged = Arr::merge($array, ...$arrays);\r\n```\r\n\r\n**None**\r\n\r\nDetermine whether no elements in an array pass a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$none = Arr::none($array, $callback);\r\n```\r\n\r\n**Only**\r\n\r\nFilter an array with only the specified key/value pairs.\r\n\r\n- `$array` is the input array.\r\n- `$keys` is an array containing the keys to include.\r\n\r\n```php\r\n$only = Arr::only($array, $keys);\r\n```\r\n\r\n**Pad**\r\n\r\nPad an array to a specified length with a value.\r\n\r\n- `$array` is the input array.\r\n- `$size` is a number representing the new size of the array.\r\n- `$value` is the value to pad with.\r\n\r\n```php\r\n$padded = Arr::pad($array, $size, $value);\r\n```\r\n\r\n**Pluck Dot**\r\n\r\nPluck a list of values using \"dot\" notation.\r\n\r\n- `$arrays` is the input arrays.\r\n- `$key` is the key to lookup.\r\n\r\n```php\r\n$values = Arr::pluckDot($arrays, $key);\r\n```\r\n\r\n**Pop**\r\n\r\nPop the element off the end of array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$pop = Arr::pop($array);\r\n```\r\n\r\n**Push**\r\n\r\nPush one or more elements onto the end of array.\r\n\r\n- `$array` is the input array.\r\n\r\nAll additional arguments supplied will be pushed onto the array.\r\n\r\n```php\r\n$newCount = Arr::push($array, ...$values);\r\n```\r\n\r\n**Random Value**\r\n\r\nGet a random value from an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$randomValue = Arr::randomValue($array);\r\n```\r\n\r\n**Range**\r\n\r\nCreate an array containing a range of elements.\r\n\r\n- `$start` is a number representing the first value of the sequence.\r\n- `$end` is a number representing the ending value in the sequence.\r\n- `$step` is a number representing the increment between values in the sequence, and will default to *1*.\r\n\r\n```php\r\n$range = Arr::range($start, $end, $step);\r\n```\r\n\r\n**Reduce**\r\n\r\nIteratively reduce an array to a single value using a callback function.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n- `$initial` is the initial value to use, and will default to *null*.\r\n\r\n```php\r\n$reduced = Arr::reduce($array, $callback, $initial);\r\n```\r\n\r\n**Reverse**\r\n\r\nReverse the order of elements in an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$reversed = Arr::reverse($array);\r\n```\r\n\r\n**Set Dot**\r\n\r\nSet a value using \"dot\" notation.\r\n\r\n- `$array` is the input array.\r\n- `$key` is the key.\r\n- `$value` is the value to set.\r\n- `$overwrite` is a boolean indicating whether previous values will be overwritten, and will default to *true*.\r\n\r\n```php\r\n$setDot = Arr::setDot($array, $key, $value, $overwrite);\r\n```\r\n\r\n**Shift**\r\n\r\nShift an element off the beginning of the array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$shift = Arr::shift($array);\r\n```\r\n\r\n**Shuffle**\r\n\r\nShuffle an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$shuffled = Arr::shuffle($array);\r\n```\r\n\r\n**Slice**\r\n\r\nExtract a slice of the array.\r\n\r\n- `$array` is the input array.\r\n- `$offset` is a number representing the starting offset.\r\n- `$length` is a number representing the length of the slice.\r\n- `$preserveKeys` determines if the array keys will be preserved, and will default to *false*.\r\n\r\n```php\r\n$slice = Arr::slice($array, $offset, $length, $preserveKeys);\r\n```\r\n\r\n**Some**\r\n\r\nDetermine whether some elements in an array pass a callback.\r\n\r\n- `$array` is the input array.\r\n- `$callback` is the callback function to use.\r\n\r\n```php\r\n$some = Arr::some($array, $callback);\r\n```\r\n\r\n**Sort**\r\n\r\nSort an array.\r\n\r\n- `$array` is the input array.\r\n- `$sort` is a number representing the sorting flag or a comparison *Closure*, and will default to *Arr::SORT_NATURAL*.\r\n\r\n```php\r\n$sorted = Arr::sort($array, $sort);\r\n```\r\n\r\n**Splice**\r\n\r\nRemove a portion of the array and replace it with something else.\r\n\r\n- `$array` is the input array.\r\n- `$offset` is a number representing the starting offset.\r\n- `$length` is a number representing the length of the slice.\r\n- `$replacement` is the element(s) to insert in the array.\r\n\r\n```php\r\n$spliced = Arr::splice($array, $offset, $length, $replacement);\r\n```\r\n\r\n**Unique**\r\n\r\nRemove duplicate values from an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$unique = Arr::unique($array);\r\n```\r\n\r\n**Unshift**\r\n\r\nPrepend one or more elements to the beginning of an array.\r\n\r\n- `$array` is the input array.\r\n\r\nAll additional arguments supplied will be prepended to the array.\r\n\r\n```php\r\n$newCount = Arr::unshift($array, ...$values);\r\n```\r\n\r\n**Values**\r\n\r\nGet all values of an array.\r\n\r\n- `$array` is the input array.\r\n\r\n```php\r\n$values = Arr::values($array);\r\n```\r\n\r\n**Wrap**\r\n\r\nCreate an array from any value.\r\n\r\n- `$value` is the value to wrap.\r\n\r\n```php\r\n$wrapped = Arr::wrap($value);\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrearray","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felusivecodes%2Ffyrearray","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felusivecodes%2Ffyrearray/lists"}