Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // .env example
- DATABASE_NAME=""
- DATABASE_USER=""
- DATABASE_PASS=""
- SECRET_KEY="souper_seekret_key"
- // Example.php You project file
- <?php
- require 'vendor/autoload.php';
- $dotenv = new Dotenv\Dotenv(__DIR__);
- $dotenv->load();
- // Accessing the .env file variables
- $dbname = getenv('DATABASE_NAME');
- $dbname = $_ENV['DATABASE_NAME'];
- $dbname = $_SERVER['DATABASE_NAME'];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement