Download the PHP package shadiakiki1986/array-utils without Composer
On this page you can find all versions of the php package shadiakiki1986/array-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shadiakiki1986/array-utils
More information about shadiakiki1986/array-utils
Files in shadiakiki1986/array-utils
Package array-utils
Short Description Useful functions for working with arrays
License MIT
Informations about the package array-utils
ArrayUtils
ArrayUtils is a collection of useful PHP array functions.
This is a fork of theodorejb/array-utils:
Major changes are that I require php>=7
for the sake of the parameter types in CellCounterManager
functions
Install via Composer
composer require shadiakiki1986/array-utils
and add bootstrap
require_once __DIR__."/vendor/autoload.php";
Functions
contains_all
Returns true if all the needles are in the haystack.
contains_same
Returns true if both arrays contain the same values (regardless of order).
group_rows
Splits the array of associative arrays into groups when the specified key value changes. The array must be sorted by the array key used to group results.
array3d2xlsx
Dumps array of arrays as xlsx file, with each subarray as a sheet
Requires apt-get install php-zip
and composer require PHPOffice/PHPExcel
For excel dates in the cells, use the \DateTime class for the php values, e.g.
Note the !
preceding Y-m-d
above resets the hours/minutes/seconds to 0 so that they don't show up in the excel data autofilter.
Check the docs for DateTime::createFromFormat for more details.
Memory issues:
- for large excel files, phpexcel could run out of memory (check here)
- Need
apt-get install sqlite3
- pass
true
for theisLarge
(2nd) parameter toarray3d2xlsx
array2console
Dumps a 3d array to a string in tabular format for viewing in the console
array2html
Dumps a 3d array to a html string in tabular format for viewing in a browser
Author
Theodore Brown
http://theodorejb.me
Shadi Akiki
License
MIT
Dev notes
If phpcs
reports errors that can be fixed automatically, run vendor/bin/phpcbf src/
and then commit the changes