PHP pass function name as param then call the function?

前端 未结 7 1717
感动是毒
感动是毒 2020-11-29 03:58

I need to pass a function as a parameter to another function and then call the passed function from within the function...This is probably easier for me to explain in code..

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-29 04:31

    I think you are looking for call_user_func.

    An example from the PHP Manual:

    
    

提交回复
热议问题