Download the PHP package fyre/array without Composer
On this page you can find all versions of the php package fyre/array. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package array
FyreArray
FyreArray is a free, open-source array manipulation library for PHP.
Table Of Contents
- Installation
- Methods
Installation
Using Composer
In PHP:
Methods
Chunk
Split an array into chunks.
$array
is the input array.$size
is a number representing the size of each chunk.$preserveKeys
is a boolean indicating whether the array keys will be preserved, and will default to false.
Collapse
Recursively replace elements into the first array.
$array
is the input array.
All arguments supplied to this method will be replace into the first array.
Column
Get the values from a single column in the input array.
$array
is the input array.$key
is the column to pull values from.
Combine
Creates an array by using one array for keys and another for its values.
$keys
is an array containing the keys.$values
is an array containing the values.
Count
Count all elements in an array.
$array
is the input array.$mode
is an integer representing the counting mode, and will default to Arr::COUNT_NORMAL.
Difference
Find values in the first array not present in any of the other arrays.
$array
is the input array.
Any additional arguments supplied will be used to test for the values of the first array.
Divide
Split an array into keys and values.
$array
is the input array.
Dot
Flatten a multi-dimensional array using "dot" notation.
$array
is the input array.$prefix
is a string representing the key prefix, and will default to null.
Except
Filter an array without the specified key/value pairs.
$array
is the input array.$keys
is an array containing the keys to remove.
Fill
Fill an array with values.
$amount
is a number representing the number of elements to insert.$value
is the value to insert.
Filter
Filter elements of an array using a callback function.
$array
is the input array.$callback
is the callback function to use.$mode
is a number determining representing which arguments will be sent to the callback, and will default to Arr::FILTER_BOTH.
If $callback
is omitted this function will filter empty elements from the array.
Find
Find the first value in an array that satisfies a callback.
$array
is the input array.$callback
is the callback function to use.$default
is the default value to return, and will default to null.
Find Last
Find the last value in an array that satisfies a callback.
$array
is the input array.$callback
is the callback function to use.$default
is the default value to return.
Flatten
Flatten a multi-dimensional array into a single level.
$array
is the input array.$maxDepth
is a number representing the maximum depth to flatten, and will default to 1.
Forget Dot
Remove a key/value pair using "dot" notation.
$array
is the input array.$key
is the key to remove.
Get Dot
Retrieve a value using "dot" notation.
$array
is the input array.$key
is the key to lookup.$defaultValue
is the default value to return, and will default to null.
Has Dot
Determine whether a given element exists in an array using "dot" notation.
$array
is the input array.$key
is the key to check for.
Has Key
Determine whether a given key exists in an array.
$array
is the input array.$key
is the key to check for.
Includes
Determine whether a given value exists in an array.
$array
is the input array.$value
is the value to check for.
Index
Index a multi-dimensional array using a given key value.
$array
is the input array.$key
is the column to pull key values from.
Index Of
Search an array for a given value and returns the first key.
$array
is the input array.$value
is the value to search for.$strict
is a boolean indicating whether a strict search will be performed, and will default to false.
Intersect
Find values in the first array present in all of the other arrays.
$array
is the input array.
All additional arguments supplied will be used to test for intersections.
Is Array
Determine whether the value is an array.
$value
is the value to test.
Is List
Determine whether an array has consecutive keys starting from 0.
$array
is the array to test.
Join
Join an array elements using a specified separator.
$array
is the input array.$separator
is a string representing the separator to join with, and will default to ","
Keys
Get all keys of an array.
$array
is the input array.
Last Index Of
Search an array for a given value and returns the last key.
$array
is the input array.$value
is the value to search for.$strict
is a boolean indicating whether a strict search will be performed, and will default to false.
Map
Apply a callback to the elements of an array.
$array
is the input array.$callback
is the callback function to use.
Merge
Merge one or more arrays.
$array
is the input array.
All additional arguments supplied will be merged with the first array.
Only
Filter an array with only the specified key/value pairs.
$array
is the input array.$keys
is an array containing the keys to include.
Pad
Pad an array to a specified length with a value.
$array
is the input array.$size
is a number representing the new size of the array.$value
is the value to pad with.
Pluck Dot
Pluck a list of values using "dot" notation.
$arrays
is the input arrays.$key
is the key to lookup.
Pop
Pop the element off the end of array.
$array
is the input array.
Push
Push one or more elements onto the end of array.
$array
is the input array.
All additional arguments supplied will be pushed onto the array.
Random Value
Get a random value from an array.
$array
is the input array.
Range
Create an array containing a range of elements.
$start
is a number representing the first value of the sequence.$end
is a number representing the ending value in the sequence.$step
is a number representing the increment between values in the sequence, and will default to 1.
Reduce
Iteratively reduce an array to a single value using a callback function.
$array
is the input array.$callback
is the callback function to use.$initial
is the initial value to use, and will default to null.
Reverse
Reverse the order of elements in an array.
$array
is the input array.
Set Dot
Set a value using "dot" notation.
$array
is the input array.$key
is the key.$value
is the value to set.$overwrite
is a boolean indicating whether previous values will be overwritten, and will default to true.
Shift
Shift an element off the beginning of the array.
$array
is the input array.
Shuffle
Shuffle an array.
$array
is the input array.
Slice
Extract a slice of the array.
$array
is the input array.$offset
is a number representing the starting offset.$length
is a number representing the length of the slice.$preserveKeys
determines if the array keys will be preserved, and will default to false.
Sort
Sort an array.
$array
is the input array.$sort
is a number representing the sorting flag or a comparison Closure, and will default to Arr::SORT_NATURAL.
Splice
Remove a portion of the array and replace it with something else.
$array
is the input array.$offset
is a number representing the starting offset.$length
is a number representing the length of the slice.$replacement
is the element(s) to insert in the array.
Unique
Remove duplicate values from an array.
$array
is the input array.
Unshift
Prepend one or more elements to the beginning of an array.
$array
is the input array.
All additional arguments supplied will be prepended to the array.
Values
Get all values of an array.
$array
is the input array.
Wrap
Create an array from any value.
$value
is the value to wrap.