|
Posted by Erwin Moller on 09/08/06 08:21
kulet wrote:
> Yes, But how do i get those last 3 lines before the blanc line???
Oh, I assumed, without any valid reason, that you only had 2 newlines.
The poor mans solution would be to do both:
\n\n\n -> \n
and
\n\n -> \n
But then again you come here and ask how to do 4 lines, right? ;-)
That can be solved easily by doing something more smarter, eg write a simple
program that scans for repetive \n and replace them with one \n, only using
basic stringfunctions.
But much easier would be to use a regular expression that can recognize any
number of repeated \n.
Use a function like preg_replace(), read more here:
http://nl3.php.net/manual/en/function.preg-replace.php
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|