我尝试了这个:
我已经尝试过这个:
<?php
$fileip = fopen("test.txt","r");
?>
这应该以只读模式打开文件,但是它没有打开。test.txt文件与index.php(主项目文件夹)在同一个文件夹中。
文件无法打开。
当我像下面这样使用echo时:
echo $fileip;
它返回了
资源标识符#3
echo file_get_contents(...
,但我添加了变量,因为OP在他的问题中提到了它。 - Tatu Ulmanen