PHP code example of juanchosl / envvars

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

    

juanchosl / envvars example snippets


use Juanchosl\EnvVars\EnvVars;

EnvVars::init(realpath(dirname(__DIR__, 1)) . DIRECTORY_SEPARATOR . '.env');

EnvVars::init(dirname(__DIR__, 1));

$envvar = EnvVars::init(dirname(__DIR__, 1).DIRECTORY_SEPARATOR.'.env-database');
$envvar->parseFile(dirname(__DIR__, 1).DIRECTORY_SEPARATOR.'.env-tokens')

$env_var = getenv('ENV_VAR_NAME');

$env_var = $_ENV['ENV_VAR_NAME'];

EVALUATED_KEY="dirname($_SERVER['DOCUMENT_ROOT']);"