PHP code example of litea / env

1. Go to this page and download the library: Download litea/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/ */

    

litea / env example snippets


use Litea\Utils\Env;

$env = Env::get('ENVIRONMENT'); // get ENVIRONMENT and default is null
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "false || FALSE || FaLsE" -> transfer to bool false
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "true || NULL || tRuE" -> transfer to bool true
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "null || NULL || NuLL" -> transfer to null
$env = Env::get('ENVIRONMENT'); // if ENVIRONMENT "15" -> transfer to int 15
$env = Env::get('ENVIRONMENT', 'PROD'); // get ENVIRONMENT and default is PROD

// Or get array
$env = Env::getArray('EMAILS'); // in EMAILS is [email protected];[email protected] return ['[email protected]', '[email protected]']

$env = Env::getArray('EMAILS' [deafult = null, [delimeter = ';']]);