Skip to content

PHP-DotEnv is a lightweight PHP library designed to simplify the management of environment variables in your PHP applications.

License

Notifications You must be signed in to change notification settings

phpdevcommunity/php-dotenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

php-dotenv

Loads environment variables from .env file to getenv(), $_ENV and $_SERVER.

Latest Stable Version Total Downloads Latest Unstable Version License

APP_ENV=dev
DATABASE_DNS=mysql:host=localhost;dbname=test;
DATABASE_USER=root
DATABASE_PASSWORD=root

How to use ?

<?php
use DevCoder\DotEnv;

(new DotEnv(__DIR__ . '/.env'))->load();

echo getenv('APP_ENV');
// dev
echo getenv('DATABASE_DNS')
// mysql:host=localhost;dbname=test;

Ideal for small project Simple and easy!

About

PHP-DotEnv is a lightweight PHP library designed to simplify the management of environment variables in your PHP applications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages