rgb192
asked on
delete the empty lines and include html
data looks like this: I do not have it in a database
want this as output (including html)
this code works but does not echo the html properly
note: I do not want to combine lines
so every line would have a linebreak <br/>
maybe like this
if(trim($line) != "")
{
echo '<br>'.$line;
}
data
<h3>more data</h3>
<p>data</p>
words
data
want this as output (including html)
data
<h3>more data</h3>
<p>data</p>
words
data
this code works but does not echo the html properly
<?php
$lines = file("sourcefile.txt");
foreach($lines as $line)
{
if(trim($line) != "")
{
echo $line;
}
}
?>
note: I do not want to combine lines
so every line would have a linebreak <br/>
maybe like this
if(trim($line) != "")
{
echo '<br>'.$line;
}
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Thanks for the points!
ASKER
thanks for the teaching
ASKER