Home Tutorial Php List PHP list class methods

 
 

Share on Google+Share on Google+
PHP list class methods
Posted on: November 2, 2009 at 12:00 AM
Advertisement
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

Advertisement

Related Tags for PHP list class methods:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 2, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com