PHP code example of dcrphp / config

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

    

dcrphp / config example snippets


  $clsConfig = new Config();  
  $clsConfig->addDirectory(__DIR__ . '\config');  
  //$clsConfig->addFile(__DIR__ . '\config\app.php'); 
  //$clsConfig = new Config(__DIR__ . '\config'); 
  //$clsConfig = new Config(__DIR__ . '\config\app.php'); 
  $clsConfig->setDriver('php');//解析php格式的  
  $clsConfig->set('my', array('email'=>'[email protected]'));
  $clsConfig->init();