PHP code example of morrislaptop / phpdotenv-safe

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

    

morrislaptop / phpdotenv-safe example snippets


$dotenv = new DotenvSafe\DotenvSafe(__DIR__);
$dotenv->load();

  if (!$this->app->configurationIsCached()) {
      $dotenv = new DotenvSafe\DotenvSafe($this->app->environmentPath(), $this->app->environmentFile());
      $dotenv->check();
  }

(new Dotenv\Dotenv(__DIR__.'/../'))->load();

(new DotenvSafe\DotenvSafe(__DIR__.'/../'))->load();

KEY=xyz php index.php