Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e1f34e commit adfc7e9Copy full SHA for adfc7e9
src/Symfony/Component/Dotenv/README.md
@@ -11,6 +11,15 @@ Getting Started
11
composer require symfony/dotenv
12
```
13
14
+Usage
15
+-----
16
+
17
+> For an .env file with this format:
18
19
+```env
20
+YOUR_VARIABLE_NAME=my-string
21
+```
22
23
```php
24
use Symfony\Component\Dotenv\Dotenv;
25
@@ -25,6 +34,12 @@ $dotenv->overload(__DIR__.'/.env');
34
26
35
// loads .env, .env.local, and .env.$APP_ENV.local or .env.$APP_ENV
27
36
$dotenv->loadEnv(__DIR__.'/.env');
37
38
+// Usage with $_ENV
39
+$envVariable = $_ENV['YOUR_VARIABLE_NAME'];
40
41
+// Usage with $_SERVER
42
+$envVariable = $_SERVER['YOUR_VARIABLE_NAME'];
28
43
29
44
30
45
Resources
0 commit comments