已經(jīng)把我的代碼修改的和答案一樣了,為什么還是提示不對(duì)?
$filename = '/data/webroot/usercode/resource/test.txt';
//編寫代碼讀取$filename的文件內(nèi)容
$content = file_get_contents($filename);
echo $content;
>>>請(qǐng)檢查輸出是否等于:this is a test file.,再試試!直接進(jìn)入下一節(jié)
$filename = '/data/webroot/usercode/resource/test.txt';
//編寫代碼讀取$filename的文件內(nèi)容
$content = file_get_contents($filename);
echo $content;
>>>請(qǐng)檢查輸出是否等于:this is a test file.,再試試!直接進(jìn)入下一節(jié)
2015-12-12
舉報(bào)
2016-02-23
第一如果沒有輸出并且你保證你寫的正確,可能是你用的瀏覽器不行,火狐就沒有輸出,你換用ie等試試,如果有輸出不通過那么你就沒必要糾結(jié)了,因?yàn)槟茏x取到數(shù)據(jù),就說明已經(jīng)獲取到內(nèi)容了,至于不通過,就是網(wǎng)站本身的錯(cuò)誤了。
2015-12-12
檢查你的路徑是否有問題。路徑有問題的話 ,是讀取不到的。
2015-12-12
它內(nèi)部服務(wù)器里的test.txt的文件內(nèi)部的文本內(nèi)容不為 this is a test file 和你沒關(guān)系。
你沒有錯(cuò)誤。想過這一節(jié) 直接
<?php
echo "this is a test file.";