php - Concat a variable to a function name -
how can concatenate variable containing string function name? tried methods, none worked me.
$mode = 'remove'; friend.$mode.($mode); function friendremove() { }
you can use call_user_func
http://lv1.php.net/call_user_func this:
$mode = 'remove'; call_user_func('friend'.$mode, $p1, $p2, ...); function friendremove($p1, $p2, ...) {}
also there call_user_func_array
function useful http://lv1.php.net/call_user_func_array
Comments
Post a Comment