PHP code example of kijtra / env

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

    

kijtra / env example snippets


composer.phar 


// Autoload only


// Load JSON file
env(array('/path/to/example.json'));

// Or multiple files
// env(array('/path/to/example.json', '../../other.json'));

// Basic use
echo env('FOO'); // "Foo value"

// You can use dot separated name
// (better than vlucas/phpdotenv)
echo env('BAR.BAR-one'); // "Bar One value"

// Get all environments
$all = env();

// If you need clear all environment, set PHP_EOL
env(PHP_EOL);


use \kijtra\Env;

// Load JSON file
Env::file('/path/to/env.json');

// Or multiple files
Env::file(array('/path/to/env.json', '../other.json'));
Env::file('/path/to/env.json', '../other.json');

// Basic use
echo Env::get('FOO');

// You can use dot separated name
echo Env::get('BAR.BAR-one');

// Get all environments
$all = Env::all();

// Clear all environment
 Env::clear();