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);
Then I select the $myData that I want and add them to a string, $str1
while(condition ){
$str1 = $str1.$myData;
$myData = fgets($fp);
}
then strip the html tags from the string
$body = strip_tags($str 1);
and use the resulting string as the body of an email
mail($to,$subje ct,$body,$from)
If I echo $body to the php page doing all this, $body displays as a single
line with no line breaks.
However the resulting email displays $body as a series of lines
corresponding to those derived from $myData = fgets($fp).
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.
Thanks
$fp = fopen("a website page", 'r');
The following accesses the stream one <td> element at a time
$myData = fgets($fp);
Then I select the $myData that I want and add them to a string, $str1
while(condition ){
$str1 = $str1.$myData;
$myData = fgets($fp);
}
then strip the html tags from the string
$body = strip_tags($str 1);
and use the resulting string as the body of an email
mail($to,$subje ct,$body,$from)
If I echo $body to the php page doing all this, $body displays as a single
line with no line breaks.
However the resulting email displays $body as a series of lines
corresponding to those derived from $myData = fgets($fp).
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.
Thanks
Comment