RE: [PHP] FILE () STRIPS BLANKS FROM THE ARRAY - HOW CAN I STOP IT

From: Date: Mon, 07 May 2001 15:45:23 +0000
Subject: RE: [PHP] FILE () STRIPS BLANKS FROM THE ARRAY - HOW CAN I STOP IT
Groups: php.general 
Request: Send a blank email to php-general+get-51764@lists.php.net to get a copy of this message
> -----Original Message----- > From: Jay Lepore [mailto:jayleporehsd@earthlink.net] > Sent: Sunday, May 06, 2001 7:41 PM > To: php-general@lists.php.net > Subject: [PHP] FILE () STRIPS BLANKS FROM THE ARRAY - HOW CAN > I STOP IT > > > I have an ASCII fixed width text file I'm trying to convert > to an array of fields. But I need to keep the spaces intact > so I know exactly where one field ends and another begins. > > Do you know of any way to modify the default behavior of > file() which strips the blanks spaces out when returning the > array? I haven't ever seen file() work that way. Are you sure this isn't a simple case of the web browser collapsing whitespace when displaying an HTML page? (Hint: "view source" is your friend when you're wanting to see exactly what the output of your script was.) --- Mark Roedel (roedelm@letu.edu) || "There cannot be a crisis next week. Systems Programmer / WebMaster || My schedule is already full." LeTourneau University || -- Henry Kissinger

« previous php.general (#51764) next »