- This reply was modified 1 year, 7 months ago by Eric Ma.
In PHP, how to call a function by its name as a string? The name strings may be known only at run time.
If the string containing the function name is
$func, you may call the function like
call_user_func() function supports more usage patterns, like
call_user_func( array($obj,$func), $params )
to call object
$obj's function named
$func with parameters
The forum ‘QA’ is closed to new topics and replies.