*/$文件=“/”文本.txt“
$text=free(fopen($file,”R“),filesize($file))
$line=expand(”R“,$text)
echo”
($I=0$I<=count($line)$I){
$TXT=expand(”t“,$line[$I])
echo”
]}
echo”。$TXT[0]。".$TXT[1]。".".$TXT[2]。".$TXT[3
//方法2
$content=filegetcontents()测试.txt“)
$arr=explode(”n“,$content)
echo””foreach($varr){
$tmp=explode(”“,$v)
echo”“
echo”“
echo”“
echo”“
echo”“
echo”“
unset($tmp)
}echo“
”。$tmp[0]。"".$tmp[1]。"".$tmp[2]。"".$tmp[3]。“”]//实际上,没有办法实现file函数,我就不多说了。检查看,它把读取的内容直接保存到数据中,不需要使用扩展功能。
/*
文本格式如下:按如下方式读取文本文件
1AAAAbbbaCCCA
2AAAABBBBCCCB
3AAAABBBCCCCC
3AAAABBBCCCCC