开发者

php call standard function by string

开发者 https://www.devze.com 2022-12-31 23:53 出处:网络
I need to call a PHP standard function from a string开发者_开发知识库 Example: $param = \"parameter\";

I need to call a PHP standard function from a string

开发者_开发知识库

Example:

$param = "parameter";
$functionname = "createimagefromjpg";
//call the function (with a parameter)

Anyone has an idea how I can do this? It can't be done with call_user_func() because it is a standard function.


$functionname($param);


Correction, ok I thought this would work:

$$functionname($param);

but it does not.... the example with one dollar sign works for functions. Nice.

0

精彩评论

暂无评论...
验证码 换一张
取 消