Read text file into array and output : Text File Read : File Directory PHP Source Code


PHP Source Code » File Directory » Text File Read »

 

Read text file into array and output



<?php
   $userfile= file_get_contents("./text.txt");

   // Place each line of $userfile into array
   $users = explode("n",$userfile);

   foreach ($users as $user) {
      list($name, $email= explode(" ", $user);
      echo "<a href="mailto:$email">$name/a> <br />";
   }
?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo File Directory
» Text File Read