Hosting Solutions
mobile_logo Table of Contents

Using the get_class_methods Function

The get_class_methods() function returns an array containing the names of the methods belonging to a specified class. The resulting array has a numeric index. demo.php <?php include_once("class1.php"); $objInstance = new class1(); $methods = get_class_methods($objInstance); foreach($methods as $method){ echo "$method <br>"; } ?> class1.php <?php class class1 { public function method_1(){ } public function method_2(){ } } ?>

PHP Videos

Object Oriented Programming

Class File Creation Tutorial Learn PHP OOPClass Properties and Methods Object Oriented ProgrammingConvert MySQL Timestamp to Ago Time Format OOP TutorialUsing the property_exists FunctionUsing the method_exists FunctionUsing the get_parent_class functionUsing the get_object_vars FunctionUsing the get_declared_classes FunctionUsing the get_class FunctionUsing the get_class_vars FunctionUsing the get_class_methods FunctionUsing the class_exists FunctionPassword Strength Check Script Class OOP TutorialExtend Class Object Oriented Programming OOP