Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Config {
- private $_config = array();
- public function delete ($name) {
- $name =& $this->_get_item($name);
- unset($name);
- }
- private function & _get_item ($name) {
- $config =& $this->_config;
- foreach (array_map("trim", explode(".", $name)) as $group) {
- if ( ! array_key_exists($group, $config) ) $config[$group] = array();
- $config =& $config[$group];
- }
- return $config;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment