âš ī¸ Warning âš ī¸ Deprecated Code! This video tutorial contains outdated code.
💡 If you wish to update it, any AI assistant will update the code for you in seconds.

Using the get_class_methods Function

Published : November 22, 2014   •   Last Edited : November 24, 2025   •   Author : Adam Khoury
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(){

	}

}
?>