Re: CSV output.
| From: | Ashley Sheridan | Date: | Tue, 09 Sep 2008 20:03:49 +0000 |
| Subject: | Re: CSV output. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279751@lists.php.net to get a copy of this message | ||
I'm guessing that when you are writing your values, you are writing
numbers to the file and not strings. With numbers, the significant
floating-point values are obviously preserved, but a number like 12.00
will be written as just 12. Try either casting the value to a string, or
having PHP auto-cast by doing something like this:
fwrite($fh, "$price");
The double quotes forces PHP to convert the number to a string.
Ash
www.ashleysheridan.co.uk