0

If I have a set of function names in an array ,how can I call a function automatically according to a user response,

array is like this ,

$functions=array("setName($param)" ,"getName()");

Functions are defined elsewhere in the code , I need a solution without using anonymous functions, is this possible? (Sorry for my bad English )

  • 3
    Take a look at `call_user_func()`: http://php.net/manual/en/function.call-user-func.php – arkascha Jan 17 '17 at 18:31
  • 1
    And if you say "set of function names", then you should actually _have_ function names, not something close to function names like `setName($param)` which certainly is _not_ simply a function name. – arkascha Jan 17 '17 at 18:32

0 Answers0