You are here: Re: Any idea how to do this? « PHP Programming Language « IT news, forums, messages
Re: Any idea how to do this?

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация