1. Go to this page and download the library: Download m1/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/ */
m1 / env example snippets
//both examples return the same thing
// example 1 -- standard
use M1\Env\Parser;
$env = new Parser(file_get_contents('test.env'));
$arr = $env->getContent();
// example 2 -- statically
$arr = Parser::parse(file_get_contents('test.env'));
var_dump($arr);
// [
// "TEST_1" => "VALUE"
// ]
//both examples return the same thing
// example 1 -- standard
use M1\Env\Parser;
$env = new Parser(file_get_contents('test_context.env'), array('EXTERNAL' => 'external'));
$arr = $env->getContent();
// example 2 -- statically
$arr = Parser::parse(file_get_contents('test_context.env'), array('EXTERNAL' => 'external'));
var_dump($arr);
// [
// "TEST_1" => "external"
// "TEST_2" => "VALUE"
// ]