Home Tutorial Php List PHP list class methods

 
 

PHP list class methods
Posted on: November 2, 2009 at 12:00 AM
In this PHP tutorial we will learn how to list methods of the class. We will also create one example to list all the methods/functions of the given class in PHP.

  • Function get_class_methods gives the all methods names of the given class.
  • It takes input as class name and returns the array of the methods name


PHP LIst Class Methods Example

<?php

class myclass{
function
aa(){}
function
bb(){}
function
cc(){}
}

$ar1
=get_class_methods("myclass");
foreach
($ar1 as $a1)
{
echo
"<br> class--> ".$a1;
}
?>


Output


class--> aa
class--> bb
class--> cc

Related Tags for PHP list class methods:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.