Re: Remove blank lines from a file
| From: | tedd | Date: | Sat, 22 May 2010 15:39:21 +0000 |
| Subject: | Re: Remove blank lines from a file | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305420@lists.php.net to get a copy of this message | ||
At 4:27 PM +0200 5/21/10, Anton Heuschen wrote:
So in the file it would look like (from the original file the user uploads that is) 1 2 3 4 5 6 but when the file is saved to the server it must look like 1 2 3 4 5 6If that is all (i.e., removing double linefeeds), then this will do it: $text_array = array(); $text_array = explode("\n\n", $input_text); $output_text = implode("\n",$text_array); Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com