<p>I have to read CSV files line by line which can be 10 to 20 Meg. <code>file()</code> is useless and I have to find the quickest way.</p>
<p>I have tried with <code>fgets()</code>, which runs fine, but I don't know if it reads a small block each time I call it, or if it caches a bigger one and optimize file I/O.
Do I have to try the <code>fread()</code> way, parsing EOL by myself?</p>

```
fgets()
```
should be perfectly fine for your needs.  Even
```
file()
```
should be ok - 20mb isn't very big unless you're doing this a lot of times concurrently.
Don't forget you can tune
```
fgets()
```
with its second parameter.