You are here: str_replace doesn't find "\n\n" « PHP Programming Language « IT news, forums, messages
str_replace doesn't find "\n\n"

Posted by Martin Magnusson on 07/13/05 11:54

I'm trying to "html-ise" some text, where an empty line should be
interpreted as a paragraph break.

I thought that
$text = str_replace("\n\n", "</p><p>", $text);
would work, but that doesn't find anything to replace in my strings, and
$text = str_replace("\n", "</p><p>", $text);
gives me too many paragraphs, of course.

As an example of what I want, this message should be divided into three
paragraphs.

 

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

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