There is a config file with a trace. content. Tell me, please, how can you use this data in your application?

<?php return array( // MySQL database details 'database' => array( 'host' => 'localhost', 'port' => '', 'username' => '', 'password' => '', 'name' => '', 'collation' => 'utf8_bin' ), // Application settings 'application' => array( // url paths 'default_controller' => 'index', 'default_action' => 'index', 'timezone' => 'UTC', ), // Session details 'session' => array( 'name' => '', 'expire' => 3600, 'path' => '/', 'domain' => '' ), // Error handling 'error' => array( 'ignore' => array(E_NOTICE, E_USER_NOTICE, E_DEPRECATED, E_USER_DEPRECATED), 'detail' => false, 'log' => false ) ); 
  • four
    . $ config = include 'file.php'; - etki

1 answer 1

Well if you include this config via

 $config = include 'file.php'; 

Then later, for example, the host can access $config['database']['host'] . Well, similar to other fields.