php call class method dynamically

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

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