PHP code example of phoole / env

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

    

phoole / env example snippets


  
  # load env file, will NOT overwrite existing env variables
  (new Phoole\Env\Environment())->load(__DIR__ . '/.env');

  // use env values
  echo getenv('APP_DIR');
  

  env->load('./.env', TRUE);
  

  # spaces before and after '=' is allowed. NOT recommended though
  ROOT_DIR = /var/tmp

  # same as above
  ROOT_DIR=/var/tmp

  # same as above
  ROOT_DIR="/var/tmp"