PHP code example of r3n0e0 / env-php
1. Go to this page and download the library: Download r3n0e0/env-php 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/ */
r3n0e0 / env-php example snippets
>>> use EnvPHP\Env;
>>> $env = Env::prefix('GITHUB_');
>>> var_dump($env);
array(2) {
'user' =>
string(3) "xxx"
'token' =>
string(3) "yyy"
}
>>> $env = Env::suffix('_TOKEN');
>>> var_dump($env);
array(2) {
'github' =>
string(3) "yyy"
'api' =>
string(3) "zzz"
}