PHP逐行读取txt文本文件

发布时间:2021年09月24日 阅读:208 次

header("Content-type: text/html; charset=utf-8");define('BASE_PATH',str_replace('\\','/',realpath(dirname(__FILE__).'/../../../'))."/");//获取根目录。无需用可以删除$file = fopen(BASE_PATH."/lei.txt", "r") or exit("Unable to open file!");while(!feof($file)){
			
    echo fgets($file). "<br />";}fclose($file);


Tag:
相关文章