Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php call class method dynamically

//  Non static call
call_user_func( array( $obj, 'method' ) );

//  Static calls
call_user_func( array( 'ClassName', 'method' ) );
call_user_func( 'ClassName::method' ); // (As of PHP 5.2.3)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #call #class #method #dynamically
ADD COMMENT
Topic
Name
5+1 =