[php] [txtfile] Lire un fichier avec la fonction file

/ Published in: PHP
Save to your folder(s)

Read a file with the file function

Copy this code and paste it in your HTML
  1. <?php
  2. //le fichier doit préexister
  3. $lines = file("fichier.txt");
  4. foreach($lines as $n => $line){
  5. echo $line . "<br />";
  6. }
  7. ?>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.