php call class method dynamically

Solutions on MaxInterview for php call class method dynamically by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "php call class method dynamically"
Noah
10 May 2017
1//  Non static call
2call_user_func( array( $obj, 'method' ) );
3
4//  Static calls
5call_user_func( array( 'ClassName', 'method' ) );
6call_user_func( 'ClassName::method' ); // (As of PHP 5.2.3)
7