woss

Config delete

Oct 29th, 2011
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. class Config {
  4.  
  5.     public function delete ($name) {
  6.        
  7.        if ( strrpos($name, '.') !== FALSE ) {
  8.            
  9.            $index = strrpos($name, '.');
  10.            
  11.            $item  = substr($name, $index+1);
  12.            $group = substr($name, 0, $index);
  13.            $group =& $this->_get_item($group);
  14.            
  15.            unset ($group[$item]);
  16.            
  17.        } else {
  18.            
  19.            unset ($this->_config[$name]);
  20.            
  21.        }
  22.        
  23.     }
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment