PHP code example of dbx12 / safe-array-read

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

    

dbx12 / safe-array-read example snippets


$array = [
    'foo' => 1
];
\dbx12\SafeArrayRead::read('foo', $array, 'baz');
# returns 1
\dbx12\SafeArrayRead::read('bar', $array, 'baz');
# returns baz