PHP code example of simplemehanizm / array

1. Go to this page and download the library: Download simplemehanizm/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/ */

    

simplemehanizm / array example snippets



$array = [
    'this' => [
        'is' => [
            'deeply' => ['nested' => 'hello world']        
        ]    
    ]
];

$value = $array['this']['is']['deeply']['nested']; // "hello world"

 

use function SimpleMehanizm\Array\Functions\readValue;

$array = [
    'this' => [
        'is' => [
            'deeply' => ['nested' => 'hello world']        
        ]    
    ]
];

$path = 'this.is.deeply.nested';

$value = readValue($array, $path); // "hello world"