Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 439 Bytes

File metadata and controls

24 lines (17 loc) · 439 Bytes

Installation

Just add the package to your project using Composer:

composer require moxemus/array-helper

Usage

Add Helper class in your project and use like a static class:

use moxemus\array\Helper as ArrayHelper;

$data = [
    'a' => 'word',
    12,5 => 23,
    null => false
];

$realFirstIndex = ArrayHelper::getFirstIndex($data); #: 'a'
$realFirstValue = ArrayHelper::getFirstValue($data); #: 'word'