79314534

Date: 2024-12-28 21:02:34
Score: 1
Natty:
Report link

For this case I've made use of fgetcsv()

    // Count Lines
    $handle     = fopen($csvfile, "r");
    $numrows    = 0;

    while (($data = fgetcsv($handle, 0)) !== FALSE) {
        $numrows++;
    }
    fclose($handle);

The second arg of fgetcsv (length) can be null since PHP 8.0

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Laurent