Mega Code Archive

 
Categories / Php / Reflection
 

Method_exists() function checks to see if a particular method, exists

Its syntax is: bool method_exists (object obj_name, string method_name) <?      class Car {           var $fourWheel;           function set() {                $this->fourWeel = 1;           }      }      $car = new Car;      if (method_exists($car, "set")) :           print "yes";      else :           print "no";      endif; ?>