Mega Code Archive

 
Categories / Php / File Directory
 

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 />";    } ?>