PHPackages                             agashe/env-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. agashe/env-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

agashe/env-parser
=================

A powerful PHP parser for env files

1.0.0(2y ago)0466—0%MITPHP

Since Oct 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/agashe/Env-Parser)[ Packagist](https://packagist.org/packages/agashe/env-parser)[ Docs](https://github.com/agashe/Env-Parser)[ RSS](/packages/agashe-env-parser/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

Env-Parser
==========

[](#env-parser)

A powerful PHP parser for env files.

Features
--------

[](#features)

- Easy to use , zero configurations
- Convert .env file into associative array
- Type casting for numbers , booleans and NULL
- Support variables with optional default values
- Support adding comments to your .env file
- Parsed data are saved in $\_ENV and $\_SERVER
- Support reading parsed data using `getenv(...)`

Installation
------------

[](#installation)

```
composer require agashe/env-parser

```

Documentation
-------------

[](#documentation)

To start using env-parser in your project , you declare a new instance of class `EnvParser` , then call `parse` method which accepts only one parameter , the path to your .env file :

```
