我正在嘗試使用 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);?不允許變量?
如何在 PHP 中使用 file_get_contents 從變量中回顯
慕工程0101907
2022-10-14 15:37:22