PHP-直接在字符串中提取函数结果

问题描述 投票:0回答:1

是否有可能在PHP的字符串中直接内联调用函数(并获取其结果?)>

通常可以使用.串联字符。

$x = "Class Name : '" . get_class($class) . "'";

我想做这样的事情:

$x = "Class Name : '${get_class($class)}'";

是否可以在PHP的字符串中直接内联调用函数(并获取其结果)?通常情况下。可以使用串联字符。 $ x =“类名:'”。 get_class($ class)。 “'”;我想要...

php syntax
1个回答
0
投票

PHP允许在string中内插only

© www.soinside.com 2019 - 2024. All rights reserved.