Garbage at beginning of uploaded Text File

From: Date: Sun, 02 Mar 2003 02:28:13 +0000
Subject: Garbage at beginning of uploaded Text File
Groups: php.general 
Request: Send a blank email to php-general+get-137740@lists.php.net to get a copy of this message
I have a form that allows someone to upload a text file, the contents of which will be inserted into the database. When I fread() the file, there is some garbage at the beginning and end of the text. Here's what the text looks like: This is the sentence of text. Here's what it looks like after uploaded and fread(): *ch?¡®ºdä?º†Ím This is the sentence of text.SORT~€ÿÿ The text file being uploaded is a BBedit file, which should be a plain text file. I'm not sure where this garbage is coming, and if there's an easy way to remove it before I put this into the Database. I searched the PHP help files for an hour and searched here, and couldn't find anything related. I'm using PHP 4.2.3 on a Redhat Linux server. Thanks.

« previous php.general (#137740) next »