Feof determines whether the fgets ends or gets an empty line, which results in more rows being read.

when opening a file using fopen
while (! feof ($File)) {

)
$arr = explode("\t", trim(fgets($File)));
echo $arr[1];

}

when making a judgment, because the last line of the open file is a blank line, use the index value of the array to output the value with notice error PHP Notice: Undefined offset would like to ask, is there any way to deal with the problem that the last line is a blank line when reading this file?

Php
Mar.17,2021

while($sRow = fgets($oFile,1024))
{
    if($sRow == "\n")
        break;
    echo $sRow;
}
Menu