Bill wrote:[color=blue]
> I am downloading data from a website that displays it in a table
> $fp = fopen("a website page", 'r');
>
> The following accesses the stream one <td> element at a time
> $myData = fgets($fp);[/color]
fgets() returns a string with the newline attached!
You may want to trim() it before processing further:
$myData = trim(fgets($fp));
[snip][color=blue]
> If I echo $body to the php page doing all this, $body displays as a single
> line with no line breaks.[/color]
Line breaks do not show up in the browser. Check the HTML source and I'm
pretty sure you will find the line breaks there.
[color=blue]
> However the resulting email displays $body as a series of lines
> corresponding to those derived from $myData = fgets($fp).[/color]
The line breaks do show on mail bodies.
[unless you send (bad) HTML mail]
[color=blue]
> Can someone please explain what is happening here?
> Ideally I would like to be able format $body so the email lines break
> differently to this.[/color]
Hopefully you will be able to do it now.
Happy Coding :-)
--
USENET would be a better place if everybody read: | to mail me: simply |
http://www.catb.org/~esr/faqs/smart-questions.html | "reply" to this post, |
http://www.netmeister.org/news/learn2quote2.html | *NO* MIME, plain text |
http://www.expita.com/nomime.html | and *NO* attachments. |