How to read a text file into PHP with set format?
My text file:
user@example.com
user1@example.com
user2@example.com
user3@example.com
user4@example.com
user5@example.com
...
How do I add the text file to my PHP file like this:
'user@example.com', 'user1@example.com'
<?php
function nl2br2($text){
return preg_replace("/\r\n|\n|\r/", "<br>", $text);
}
$str= file_get_contents("sheet5.txt");
echo nl2br2($str);
?>
This page / code keeps running, how to make it stop at the end of the file?