PHP code example of henrik / environment

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

    

henrik / environment example snippets



$iniConfigParser = new IniEnvironmentParser();
$env             = new Environment($iniConfigParser);
$env->load(__DIR__.'/stubs/env.ini');

//here parameters is our section name 
//get method returns array of parameters in this point
//and we can work with them as php assoc array
$env->get('parameters')['basePath'];