PHP code example of mirkoschmidt / arraydot
1. Go to this page and download the library: Download mirkoschmidt/arraydot 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/ */
mirkoschmidt / arraydot example snippets
$array = [
'config' =>
'group' => [
'setting' => 'value',
'setting2' => 'value2',
],
],
];
$array = array_dot($array);
// Elements can now be accessed using dot notation, like the example below.
// Echos: 'value';
echo $array['config.group.setting'];
// To return the array back to the original, the following
// line can be used.
$array = array_undot($array);
// Echos 'value2'
echo $array['config']['group']['setting2'];