file.php : file function « File Directory « PHP






file.php

 
<?php
   $users = file("data.txt");

   foreach ($users as $user) {
      list($name, $email) = explode(" ", $user);

      $email = trim($email);
      echo "<a href=\"mailto:$email\">$name</a> <br />\n";
   }
?>
  
  








Related examples in the same category

1.Reading a File into an Array
2.PHP File Logic Functions