PHP code example of folded / config

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

    

folded / config example snippets


use function Folded\setConfigFolderPath;
use function Folded\setEnvFolderPath;

setEnvFolderPath(__DIR__);
setConfigFolderPath(__DIR__ . "/config");

use function Folded\getConfig;

echo getConfig("app.name");

return [
	"name" => "Folded",
];

echo Folded\getEnv("APP_NAME");

use function Folded\hasConfig;

if (hasConfig("app.name")) {
	echo "config exist";
} else {
	echo "config don't exist";
}

use function Folded\hasEnv;

if (hasEnv("APP_NAME")) {
	echo "has env";
} else {
	echo "has not env";
}

use function Folded\getAllConfig;

$app = getAllConfig("app");

echo $app["name"];