简体   繁体   English

$ {}在php中是什么意思?

[英]What does ${} mean in php?

I get PHP file(class) from internet and on the file doc said include file like this: 我从互联网上获取了PHP文件(类),文件doc上说包含文件是这样的:

${(require_once('file.php'))}->FunctionName();

i just need to know what mean of " ${} " in this line 我只需要知道这一行中“ ${} ”的含义

It is evaluating the contents of file.php and returning it as a string 它正在评估file.php的内容并将其作为字符串返回

For example - if file.php contained "test" - then it will be end up being 例如-如果file.php包含“ test”-那么它将最终被

$test->FunctionName();

But this just seems like very bad code... evaluating a file, and including it as a variable is just going to end in tears... 但这似乎是非常糟糕的代码...评估文件,并将其作为变量包含在内,简直要哭了...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM