Reputation: 4043
Reading text file truncates line output in PHP:
NEXT_GEN_TO="Project Bribara<[email protected]>"
$lines = file('Text-file');
foreach ($lines as $line) {
echo "$line</br>";
}
NEXT_GEN_TO="Project Bribara<[email protected]>"
NEXT_GEN_TO="Project Bribara"
How can I print expected result after reading the lines from file?
Upvotes: 0
Views: 33
Reputation: 5316
Try to give output like this...
echo htmlentities($line) . "</br>";
Upvotes: 1
Reputation: 2684
The <[email protected]>
is treated as an html tag by your browser. If you check out the outputted html source code for the page using "View Source" in your browser, it's all going to be there.
Use one of the php functions to turn html into non-html text such as htmlentities() on the text before output.
http://php.net/manual/en/function.htmlentities.php
Upvotes: 2