/php-dotenv

Lightweight parser for `.env` files for PHP.

Primary LanguagePHPGNU General Public License v2.0GPL-2.0

PHP DotEnv Parser

Lightweight parser for `.env` files for PHP.


Features

  • Parse .env files and access them with $_ENV.

Installation & Usage

Composer installation:

composer req "noelclick/php-dotenv"

Load the environment variables

// Composer autoloader
require "./vendor/autoload.php"; 

// Load environment variables
    (new \NoelClick\PhpDotEnv\DotEnv(__DIR__ . '/../.env'))
        ->load();
    echo $_ENV["APP_NAME"];

Changelog

All notable changes to this project will be documented in the CHANGELOG.md file.

Copyright

© Copyright 2022 by Noel Kayabasli