PHP code example of damian972 / dotenv-loader

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

    

damian972 / dotenv-loader example snippets




(new Damian972\DotenvLoader\Dotenv(__DIR__, fileName: '.env'))->load(); // fileName parameter is optionnal, default: .env

echo 'API_LOGIN = '.getenv('API_LOGIN').PHP_EOL;