PHP code example of mnlnk / array

1. Go to this page and download the library: Download mnlnk/array library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mnlnk / array example snippets




use Manuylenko\ArrayHelper\Arr;

$arr = [
    //
];

Arr::set($arr, 'key', 'value1');

Arr::set($arr, 'key2.key3', 'value3');

$value = Arr::get($arr, 'key'))

$value = Arr::get($arr, 'key.key2'))

$value = Arr::get($arr, 'key', 'fallback'))

Arr::has($arr, 'key')

Arr::remove($arr, 'key')

Arr::wrap($arr, 'value')