Download the PHP package nick-lai/associative-array without Composer
On this page you can find all versions of the php package nick-lai/associative-array. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nick-lai/associative-array
More information about nick-lai/associative-array
Files in nick-lai/associative-array
Package associative-array
Short Description A lightweight associative array library for PHP.
License MIT
Homepage https://github.com/nick-lai/associative-array
Informations about the package associative-array
AssociativeArray
A lightweight associative array library for PHP.
Table of Contents
- Requirements
- Installation
- Basic Usage
- select()
- where()
- innerJoin()
- leftJoin()
- rightJoin()
- orderBy()
- groupBy()
- make()
- first()
- last()
- count()
- sum()
- avg()
- toArray()
- Array Access
- Traversable
- License
Requirements
AssociativeArray requires PHP >= 7.0.0
Installation
Basic Usage
Result:
select()
Get rows of selected columns.
Result:
where()
Filter the rows using the given callback.
Result:
innerJoin()
Inner join rows
Result:
leftJoin()
Left join rows
Result:
rightJoin()
Right join rows
Result:
orderBy()
Order by keys
Result:
Keep index
Result:
groupBy()
Groups an associative array by keys.
Result:
make()
Create a new associative array instance.
Result:
first()
Return the first row
Result:
last()
Return the last row
Result:
count()
Count the number of rows in the associative array.
Result:
sum()
Get the sum of a given key.
Result:
avg()
Get the average value of a given key.
Result:
toArray()
Get the instance as an array.
Result:
Array Access
Result:
Traversable
Result:
License
AssociativeArray is released under the MIT Licence. See the bundled LICENSE file for details.