Skip to content

Instantly share code, notes, and snippets.

@kjohnson
Last active September 4, 2015 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjohnson/a12740576c56ffaabe96 to your computer and use it in GitHub Desktop.
Save kjohnson/a12740576c56ffaabe96 to your computer and use it in GitHub Desktop.
Loading configuration arrays from another file
<?php
class Foo
{
protected $_settings = array();
public function __construct()
{
$this->_settings = include 'config.php';
}
public function getSettings()
{
return $this->_settings;
}
}
<?php
return array(
'a' => 'aye',
'b' => 'bee',
'c' => 'see'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment