PHP: Lire un fichier mot par mot

Author:
 
<?php
$fh = fopen('test.txt','r') or die($php_errormsg);
while (! feof($fh)) {
    if ($s = fgets($fh)) {
        $words = preg_split('/s+/',$s,-1,PREG_SPLIT_NO_EMPTY);
    }
}
fclose($fh) or die($php_errormsg);
?>
  
  

Leave a Reply

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


− five = 4