标签:close fun pen eof fopen 初始化 icon adf str
public function readFile($path){
$data = array();
$returnTxt = ‘‘; // 初始化返回
$i = 1;
$fh = fopen($path,"r");
while (!feof($fh)){
$line = fgets($fh, 4096);
if($i>=3 && !empty($line)){
$returnTxt = $line;
$str = iconv(‘GB2312‘,‘UTF-8‘,$returnTxt);
$arr = explode(‘,‘,$str);
$data[] = $arr;
}
$i++;
}
fclose($fh);
}
$path="文件路径";
readFile($path);
标签:close fun pen eof fopen 初始化 icon adf str
原文地址:https://www.cnblogs.com/lsbaiwyl/p/9020041.html