例子
example usage
this method of iterating over the file and seeking to the line number works well and is memory efficient, but it would be nice to have php do the work for us. php provides the spl file object which will do exactly what is required.
seek( $line_number );
/*** return the current line ***/
return $file_obj->current();
}
echo readline( $file, 345678 );
?>