All pastes #372562 Raw Edit

Mine

public text v1 · immutable
#372562 ·published 2007-02-26 04:36 UTC
rendered paste body
        /**
         * This is the same as the set function except it takes an array as input
         */
        
        public static function set_by_array($array, $clobber = 0) {
                
                if (isset($this)) {                     
                        foreach ($array as $name => $value) {
                                $this->set($name, $value, $clobber);
                        } // end foreach
                } // if this is an object
                else { 
                        foreach ($array as $name => $value) { 
                                self::set($name,$value,$clobber); 
                        } 
                } // end if procedural call

        } // set_by_array