Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit fa92d2b

Browse files
author
F. Michel
authored
update readme
1 parent d70af84 commit fa92d2b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

‎README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,26 @@
11
# php-dotenv
2+
# Loads environment variables from .env file to getenv(), $_ENV and $_SERVER.
3+
4+
```
5+
APP_ENV=dev
6+
DATABASE_DNS=mysql:host=localhost;dbname=test;
7+
DATABASE_USER=root
8+
DATABASE_PASSWORD=root
9+
```
10+
11+
12+
```
13+
**How to use ?**
14+
```php
15+
<?php
16+
use DevCoder\DotEnv;
17+
18+
(new DotEnv(__DIR__ . '/.env'))->load();
19+
20+
echo getenv('APP_ENV');
21+
// dev
22+
echo getenv('DATABASE_DNS')
23+
// mysql:host=localhost;dbname=test;
24+
```
25+
Ideal for small project
26+
Simple and easy!

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /