Is that possible to expand function call in PHP string?

Chaldo13

New Member
I tried to call \[code\]foo()\[/code\] inside a string like this:\[code\]echo "This is a ${foo()} car";function foo() { return "blue";}\[/code\]but, it ends up with a syntax error.I found here something similar, but not exactly what I need:\[code\]echo "This is the value of the var named by the return value of getName(): {${getName()}}";\[/code\]Is that possible to do this ?
 
Back
Top