How can I create a function dynamically?

后端 未结 5 1425
独厮守ぢ
独厮守ぢ 2020-12-31 05:28

I have a variable like $string = \"blah\";

How can I create a function that has the variable value as name? Is this possible in PHP?

Like

5条回答
  •  隐瞒了意图╮
    2020-12-31 05:41

    You can call a function by its name stored in a variable, and you can also assign a function to variables and call it using the variable. If it's not what you want, please explain more.

提交回复
热议问题