PHP dotenv is a PHP library that loads environment variables from a text file named .env for easy access from PHP code. This library is based on the Ruby gem (see [ruby-dotenv] tag.) There is also a Node.js module (see [dotenv] tag.)
Loads environment variables from .env to getenv(), $_ENV and $_SERVER automagically.
Code repository: https://github.com/vlucas/phpdotenv
Packagist page: https://packagist.org/packages/vlucas/phpdotenv