PHP Classes

File: vendor/env/dotenv/README.md

Recommend this page to a friend!
  Classes of Melanie Wehowski   PHP RDAP Server   vendor/env/dotenv/README.md   Download  
File: vendor/env/dotenv/README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP RDAP Server
Process RDAP queries about an IP address or domain
Author: By
Last change:
Date: 1 month ago
Size: 734 bytes
 

Contents

Class file image Download

Dotenv

A simple and tiny PHP .env loader, which does not inject values into $_ENV or OS.

Installation

composer require env/dotenv

Usage

The .env file should have a valid .ini syntaxis, supported by parse_ini_file.

This package does not inject values into global $_ENV or OS wia putenv() so it's up to you how you wan't proceed with parsed data.

Load

Parse .env and get values as array:

$env = \Env\Dotenv::toArray(
    path: '.env',
    strict: false, // by default: true
);

If you need variables and fallback values, set strict to false