Wednesday 15 April 2015

arrays - PHP: get all method names from an object with name "bla_" -


I have an object and want a method that gives this object the way to start with "bla_" is.

I found get_class_methods () which gives all the names of the names, but I only want those names that are "bla _"

You can use them to filter:

  $ method_names = preg_grep ('/ ^ bla_ /', get_class_methods ($ object) );  

No comments:

Post a Comment