Skip to content

Commit d392eed

Browse files
authored
Update readme.md
1 parent 25cf762 commit d392eed

File tree

1 file changed

+30
-3
lines changed

1 file changed

+30
-3
lines changed

readme.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
![banner](https://user-images.githubusercontent.com/7104395/60439675-c7300400-9c45-11e9-846a-e0819aeb74dd.png)
2+
13
# AssociativeArray
24

5+
[![PHP 7 ready](https://php7ready.timesplinter.ch/nick-lai/associative-array/master/badge.svg)](https://travis-ci.org/nick-lai/associative-array)
36
[![Build Status](https://travis-ci.org/nick-lai/associative-array.svg?branch=master)](https://travis-ci.org/nick-lai/associative-array)
47
[![codecov](https://codecov.io/gh/nick-lai/associative-array/branch/master/graph/badge.svg)](https://codecov.io/gh/nick-lai/associative-array)
58
[![Maintainability](https://api.codeclimate.com/v1/badges/619cef82d3eba2ea735c/maintainability)](https://codeclimate.com/github/nick-lai/associative-array/maintainability)
69
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nick-lai/associative-array/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nick-lai/associative-array/?branch=master)
7-
8-
[![PHP 7 ready](https://php7ready.timesplinter.ch/nick-lai/associative-array/master/badge.svg)](https://travis-ci.org/nick-lai/associative-array)
910
[![Latest Stable Version](https://poser.pugx.org/nick-lai/associative-array/v/stable)](https://packagist.org/packages/nick-lai/associative-array)
1011
[![Total Downloads](https://poser.pugx.org/nick-lai/associative-array/downloads)](https://packagist.org/packages/nick-lai/associative-array)
11-
[![License](https://poser.pugx.org/nick-lai/associative-array/license)](https://packagist.org/packages/nick-lai/associative-array)
12+
13+
**A lightweight associative array library for PHP.**
1214

1315
# Table of Contents
1416

@@ -22,6 +24,7 @@
2224
- [rightJoin()](#rightjoin)
2325
- [orderBy()](#orderby)
2426
- [groupBy()](#groupby)
27+
- [make()](#make)
2528
- [first()](#first)
2629
- [last()](#last)
2730
- [count()](#count)
@@ -501,6 +504,30 @@ array (
501504
)
502505
```
503506

507+
### make()
508+
509+
Create a new associative array instance.
510+
511+
```php
512+
$data = [
513+
['id' => 1001, 'category' => 'C', 'price' => 10],
514+
['id' => 1002, 'category' => 'A', 'price' => 25],
515+
['id' => 1003, 'category' => 'B', 'price' => 10],
516+
];
517+
518+
var_export(AssociativeArray::make($data)->first());
519+
```
520+
521+
Result:
522+
523+
```
524+
array (
525+
'id' => 1001,
526+
'category' => 'C',
527+
'price' => 10,
528+
)
529+
```
530+
504531
### first()
505532

506533
Return the first row

0 commit comments

Comments
 (0)