PHP code example of skunbydev / dot-env
1. Go to this page and download the library: Download skunbydev/dot-env library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
skunbydev / dot-env example snippets
sh
// Acesse as variáveis de ambiente carregadas
$appName = getenv('APP_NAME');
$dbHost = $_ENV['DB_HOST'];
$dbUsername = $_SERVER['DB_USERNAME'];
// Use as variáveis conforme necessário
echo "Application Name: $appName\n";
echo "Database Host: $dbHost\n";
echo "Database Username: $dbUsername\n";