How To Call Functions Within Classes Dynamically In PHP
erics, Posted January 19th, 2012 at 11:12:55am
1 2 3 4 5 6 7 8 9 |
public function valid($function = '') { $methodVariable = array($this, $function); if (is_callable($methodVariable)) { return $this->{$function}(); } else { $this->msgs[] = "Validation method $function is unavailable!"; return 0; } } |
Leave Your Comment
All fields marked with "*" are required.