问答详情
源自:5-1 PHP文件系统之读取文件内容

$content = file_get_contents('./test.txt');//"./test.txt"表示么意思?

<?php

$filename = '/data/webroot/usercode/resource/test.txt';

//编写代码读取$filename的文件内容

$content = file_get_contents('./test.txt');//"./test.txt"表示么意思?

echo 'this is a test file.';

$fp = fopen('./text.txt', 'rb');
while(!feof($fp))//"!feof()"表示么意思?

 {
   echo fgets($fp); //读取一行
}
fclose($fp);


提问者:web_東 2016-12-17 22:50

个回答

  • 悠扬012
    2017-01-08 17:41:45
    已采纳

    "./test.txt"指的是文件的路径,用来表示这个文件在哪,怎么找到。"!feof()"检测是否已到达文件末尾

  • caicai31
    2016-12-18 14:56:39

    文件省略路径