https://github.com/fetch/php-array-utils
PHP array utility functions
https://github.com/fetch/php-array-utils
Last synced: 10 months ago
JSON representation
PHP array utility functions
- Host: GitHub
- URL: https://github.com/fetch/php-array-utils
- Owner: fetch
- License: mit
- Created: 2015-03-16T16:08:34.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-14T11:42:25.000Z (over 10 years ago)
- Last Synced: 2025-05-17T09:37:58.598Z (11 months ago)
- Language: PHP
- Size: 160 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP array utility functions. [](https://travis-ci.org/fetch/php-array-utils)
This is a set of utility functions for array alteration and handling.
They all follow the same naming conventions as the default methods in the form of `array_*`.
## Functions
#### `array_delete(array &$array, $key)`
Deletes entry from array and return its value.
_NB: This method modifies the original variable._
#### `array_get(array $array, $key)`
Lookup entry in array by key and return its value, returns `false` if not found.
#### `array_flatten(array $array)`
Make multidimensional array flat.
#### `array_pick(array $array, $keys[, $key[, $key]])`
Return array with only the keys in `$keys`.
#### `array_reject(array $array, $keys[, $key[, $key]])`
Return array without the keys in `$keys`.
This is the inverse of `array_pick`
## Contributing
1. Fork it ( https://github.com/fetch/php-array-utils/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request