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

时间:2015-03-28 11:39:39

标签: php file web include

我有一个问题,包括一个php文件。我在网上搜索过,并以不同的方式进行了三小时的排查,但我无法自行解决。

我有一个名为" side9test.php"使用此代码:

<?php

include "styret/fil-liste.php"; 

?>

文件&#34; fil-liste.php&#34;包含:

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

?>

文件&#34; m_0.txt&#34;包含这个:

forste mappa

但问题是,当我运行&#34; side9test.php&#34;时,它给我的全部是:

</br>

感谢所有反馈!

1 个答案:

答案 0 :(得分:2)

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

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

相关问题