In PHP, How to call function in string?

前端 未结 7 1937
误落风尘
误落风尘 2020-12-10 04:42

say,string is:

$str=\"abcdefg foo() hijklmopqrst\";

How to let php call foo() and insert the return string to this string?

相关标签:
7条回答
  • 2020-12-10 05:23
    function foo()
    {
        return 'Hi';
    }
    $my_foo = 'foo';
    echo "{$my_foo()}";
    
    0 讨论(0)
提交回复
热议问题