1. Go to this page and download the library: Download datahihi1/tiny-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/ */
datahihi1 / tiny-env example snippets
use Datahihi1\TinyEnv\TinyEnv;
$env = new TinyEnv(__DIR__);
$env->load();
use Datahihi1\TinyEnv\TinyEnv;
$env = new TinyEnv(__DIR__,true);
use function Datahihi1\TinyEnv\env;
$env = env('NAME');
print_r($env); // Result: TinyEnv
use function Datahihi1\TinyEnv\env;
$env = env('TESTER','Datahihi1');
print_r($env); // Result: Datahihi1
print_r(env());
use function Datahihi1\TinyEnv\setenv;
setenv('KEY','demo'); // will set or update environment variable in .env file
print_r(env()); // Output is variable in .env file.
$env->unload();
print_r(env()); // Nothing output. Variable has been cleared
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.