How To Call Functions Within Classes Dynamically In PHP
erics, January 19th, 2012
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; } } |