I have searched the site but none of the answers i found has worked so far so i'm seeking additional help.
I want to print the lines from a text file line by line (one under the other) but i do not wish to use iframe here is my code so far:
HTML-PHP
<td>
<?php
$handle = fopen("textfilelocation/$text.txt", "r");
if ($handle) {
while (($line = fgets($handle)) !== false) {
echo $line;
}
fclose($handle);
}
else {
echo "Error accessing Tracking Data";
}
?>
</td>
Text file
Hello,World
March 3, 2018, 3:00am
Enjoy, life
Ouput
Hello,World March 3, 2018, 3:00am Enjoy, life
What i want is
Hello,World
March 3, 2018, 3:00am
Enjoy, life
after it. – Zachary Craig Mar 21 '18 at 17:40
`? `echo $line . "
\n";` – Andreas Mar 21 '18 at 17:40
'; – fortune Mar 21 '18 at 17:41