PHP code example of rasmuscnielsen / dotarray

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

    

rasmuscnielsen / dotarray example snippets


$source = array();
$dotArray = DotArray::tap($source);

echo $dotArray->get('garage.cars.mercedes.model'); // S-class
echo $dotArray->get('garage.cars.merecedes.origin'); // NULL
echo $dotArray->get('garage.cars.mercedes.maxspeed', '250km/t'); // 250km/t

// or search out your object
$mercedes = $dotArray->open('garage.cars.mercedes');
echo $dotArray->wheelsize; // 22-inches

// of course you have the whole thing in your souce 
print_r($source); 

// [
//	'garage' => [
//    	'cars' => [
//        	'merecedes' => [
//				'model' => 'S-class',
//				etc...
//]