I use PHP to create basic HTML. Tags are always the same, but the actual links / headers correspond to PHP variables:
$string = '<p style="..."><a href="'.$html[$i].'"><strong><i>'.$title[$i].'</i></strong></a>
<br>';
echo $string;
fwrite($outfile, $string);
The resulting html, both reflected (when I look at the source of the page), and in a simple txt file that I write, read as follows:
<p style="..."><a href="http://www.example.com
"><strong><i>Example Title
</i></strong></a></p>
<br>
While this works, this is not exactly what I want. It looks like PHP adds a line break every time I break a line to insert a variable. Is there a way to prevent this behavior?
source
share