B-219 Sec-55 Noida, India
+918010221733

Get methods of an object

First, use get_class to get the name of an object’s class.

<?php $class_name = get_class($object); ?>

Then, pass that get_class_methods to get a list of all the callable methods on an object

<?php
$class_name = get_class($object);
$methods = get_class_methods($class_name);
foreach($methods as $method)
{
var_dump($method);
}
?>
(Visited 32 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.