Created
January 7, 2015 15:03
-
-
Save brandonsavage/801f921012d553b1a95d to your computer and use it in GitHub Desktop.
My favorite function in PHP...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function configure(array $values = array()) | |
{ | |
foreach ($values as $key => $value) { | |
if (property_exists($this, $key)) { | |
$this->$key = $value; | |
} | |
} | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment