PHP code example of extphp / data-dot

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

    

extphp / data-dot example snippets




use ExtPHP\DataDot\Dot;

$data = [
    'eyes'  => 'blue',
    'age'   => '27',
    'parents' => [
        'mother'    => 'Jane',
        'father'    => 'Jack'
    ]
];

$dot = new Dot($data);

$dot->get('parents.father', 'John');    // returns 'Jack'
$dot->get('sister', 'Kate');            // returns 'Kate'
bash
php vendor/bin/phpunit