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