fscanf.php : fscanf « File Directory « PHP






fscanf.php

 
<?php
   $fh = fopen("data.txt", "r");

   while ($user = fscanf($fh, "%d-%d-%d")) {
      list ($part1,$part2,$part3) = $user;
      print $part1;
      print $part2;
      print $part3;
      
   }

   fclose($fh);
?>
  
  








Related examples in the same category

1.Acceptable Format Values for fscanf()
2.Reading Formatted Text Using fscanf()