This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class env | |
{ | |
//usage: | |
//env::$load() // loads .env file | |
//env::$load("dev") //loads dev.env file | |
//CAUTION! : at an empty line after the last variable entry. see example below | |
public static function load ($prefix="") { | |
$file = file($_SERVER['DOCUMENT_ROOT'].'/ici/'.$prefix.'.env'); | |
foreach ($file as $line_num => $line) { |