RE: [users@httpd] Delete Blank Lines In A Text File

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



preg_replace($pattern, $replacement, $string);
 
preg_replace("/\n\r *\n\r/","\n\r", $string )
 
\n\r *\n\r - for a windowz maching and they may be in the wrong order.
 
Your basically replacing all double linefeeds with a single linefeed.
Replace the \n\r with whatever your OS uses as a linefeed.
 
 
Thanx
Aaron N Wagner
Monitoring Systems and Network Tools
CCO-Command Center Operations
804.515.6298
 


From: Christopher Deeley [mailto:chrisdeeleyuk@xxxxxxxxx]
Sent: Tuesday, December 27, 2005 4:17 PM
To: users@xxxxxxxxxxxxxxxx
Subject: [users@httpd] Delete Blank Lines In A Text File

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' tries to read each line of the text file.
 
Thanks

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux