I am using:
<?php $emails = get_stylesheet_directory_uri().'/files/emails.txt'; ?>
<?php $filecontents = file_get_contents($emails);?>
<?php print $filecontents;?>
to print out contents inside a text file. The printed out text should be displayed vertically just like it is displayed inside the text file but it is displayed horizontally once printed out.
Your help would be appreciated.
you may want to look at php’s function nl2br
Instead of getting that in
file_get_contents
, grab that underfile()
and thenimplode()
it up using a<br>
tag.HTML requires use of the
<br>
tag to create line breaks (or block level elements). In your code you aren’t doing anything to indicate you want a new line. Not even a new line charactern
.