PHP: Trouver le nombre de ligne d’un fichier

Author:
 
<?php
$lines = 0;
 
if ($fh = fopen('data.txt','r')) {
  while (! feof($fh)) {
    if (fgets($fh)) {
      $lines++;
    }
  }
}
print $lines;
?>
  
  

Leave a Reply

Your email address will not be published. Required fields are marked *


three × 1 =