Re: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Ken Robinson
Quoting Christopher Deeley [EMAIL PROTECTED]: Does anyone know how to use PHP to delete blank lines in a text file. I use a text file to store usernames and passwords but with adding and deleting users, blank lines appear which returns an undefined offset error when the 'verify user script'

RE: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Wagner, Aaron
804.515.6298 -Original Message- From: Ken Robinson [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 27, 2005 4:54 PM To: users@httpd.apache.org Subject: Re: [EMAIL PROTECTED] Delete Blank Lines In A Text File Quoting Christopher Deeley [EMAIL PROTECTED]: Does anyone know how

RE: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Ken Robinson
Quoting Wagner, Aaron [EMAIL PROTECTED]: That's nice but it doesn't fix the blank lines it just skips them in the file parse. I think he wants to clean the file. If the file gets big, he could take a performance hit skipping multiple lines. If you ran the script you would see that the

Re: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Boysenberry Payne
Try: $string = file_get_contents( test.text ); $string = file_put_contents( test.text, preg_replace( /(\r\n|\r|\n)(\s)*(\r\n|\r|\n)/, $1, $string ) ); Boysenberry boysenberrys.com | habitatlife.com | selfgnosis.com On Dec 27, 2005, at 3:16 PM, Christopher Deeley wrote: Does anyone know

RE: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Wagner, Aaron
PROTECTED] Sent: Tuesday, December 27, 2005 5:05 PM To: users@httpd.apache.org Subject: RE: [EMAIL PROTECTED] Delete Blank Lines In A Text File Quoting Wagner, Aaron [EMAIL PROTECTED]: That's nice but it doesn't fix the blank lines it just skips them in the file parse. I think he

RE: [EMAIL PROTECTED] Delete Blank Lines In A Text File

2005-12-27 Thread Ken Robinson
At 05:35 PM 12/27/2005, Wagner, Aaron wrote: k, I didn't see you filehandle on the fwrite. I didn't know that you could write to the same file your reading? Interesting Actually, I use the file() function to read the whole file into an array, so the file isn't open when you do the fopen() of