New line char problem
| From: | Lee P. Reilly | Date: | Tue, 06 May 2003 15:16:04 +0000 |
| Subject: | New line char problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146531@lists.php.net to get a copy of this message | ||
Hi,
I wonder if anyone can offer a solution to the following problem?
I am translating files from one format to another, and am having some
issues with new line characters. The following code is the root of the
problem:
for($i = 0; $i < $noOfDataPoints ; $i++)
{
$IQdata .= " " . (float)$Q[$i] . " \t" . (float)$I[$i] . " \t"
.
(float)$E[$i] . "\n";
}
If I display the contents of $IQdata within <PRE> tags, it appears fine
i.e. like:
---------------------
236.472 170.2914 40.7214
431.389 156.4599 48.101
1210.67 101.1621 93.5787
2174.39 32.77706 158.6924
2347.52 20.4919 170.6606
1866.15 54.6496 137.5213
---------------------
When I try and save the contents of $IQdata to a file, the new line
characters (\n or \r) appear as *square* characters. Is there a way to
remedy this?
Thanks in advance,
Lee
--
Lee P. Reilly ms:G758
Center for Human Genome Studies tel:505-665-7025
Bioscience Division (B-5)
SM-30 Bikini Atoll Rd,
Los Alamos National Laboratory, mailto:lreilly@lanl.gov
Los Alamos, NM 87545. http://home.lanl.gov/lreilly
-._ _.--'"
'--._ _.--'"'--._
_.--'"`'--._ _
'-:.'||"':-. '-:.'||"':-.
'-:.'||"':-. '.` : '.
'. '. | | | |'. '. | | | |'. '. | | | |'. '.:
'. '.
: '. '.| | | | '. '.| | | | '. '.| | | | '. '.
: '. `.
' '. .:_ | :_.' '. .:_ | :_.' '. .:_ |
:_.' '. .' `.
-..,..-' -..,..-' -..,..-'
`