我正在尝试使用 file_get_contents 回显 .php 文件的内容。应该从其中回显内容的文件名部分由 sql 查询生成,如下所示:$property_info = '"include/textfiles/' . $properties['expose_info'] . '_info.php"';然后我试图做echo file_get_contents($property_info);出于某种原因,这不起作用,但是如果我正在echo $property_info;输出正确的文件路径,并且当我将该文件路径复制粘贴回 file_get_contents 时,它也会以我想要的方式回显文件内容。那么不工作的原因是什么echo file_get_contents($property_info);?不允许变量?
1 回答

白猪掌柜的
TA贡献1893条经验 获得超10个赞
利用
$property_info = 'include/textfiles/' . $properties['expose_info'] . '_info.php';
不是
$property_info = '"include/textfiles/' . $properties['expose_info'] . '_info.php"';
原因 :
Your $property_info contain double qoute inside single quote
- 1 回答
- 0 关注
- 135 浏览
添加回答
举报
0/150
提交
取消