1. Go to this page and download the library: Download melbahja/environ 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/ */
melbahja / environ example snippets
use Melbahja\Environ\Environ;
// environ looking for .env or env.ini file in your directory
Environ::load('/path/to/your/project');
var_dump(Environ::get('APP_MODE')); // string
var_dump(Environ::get('DATABASE')); // array
var_dump($_ENV['DATABASE']); // array
# if you want a helper
function env(string $var, $default = null)
{
return \Melbahja\Environ\Environ::get($var, $default);
}