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();
echo env('DB_HOST', 'localhost');
$env->load(); // Load all
$env->load(['DB_HOST']); // Load specific keys
$env = new TinyEnv(__DIR__, true); // Load immediately
echo env('NAME'); // Get value
echo env('NOT_FOUND', 'backup'); // With default
print_r(env()); // Get all (in .env file)
print_r(sysenv()); // Get all system variables
validate_env([
'VERSION' => 'EBUG' => 'bool'
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.