(PHP)include函数只包含文件的某些部分


(PHP) The include function only includes some parts of the file

我在包含php文件时遇到问题。我在网上搜索了三个小时,并以不同的方式解决了问题,但我自己无法解决。

我有一个名为"side9test.php"的文件,代码是:

<?php
include "styret/fil-liste.php"; 
?>

文件"fil-liste.php"包含:

<?php
echo "</br>";
echo file_get_contents("filsystem_navn/m_0.txt");
?>

文件"m_0.txt"包含以下内容:

forste mappa

然而,问题是,当我运行"side9test.php"时,它给我的只是:

</br>

我感谢所有的反馈!

我认为您的文件路径是正确的,只需将代码更改为echo file_get_contents("filsystem_navn/m_0.txt",true);

设置为true1将搜索包含路径:)