技术笔记
一名已转行的程序员PHP逐行读取txt文本文件
2018-08-06 / 代码笔记 / 1433 次围观 / 0 次吐槽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);
推荐您阅读更多有关于“”的文章
Powered By Z-BlogPHP
Copyright 技术笔记 Rights Reserved.
额 本文暂时没人评论 来添加一个吧
发表评论