You are here: Re: Replace the CR/LF in a textarea by str_replace « PHP Programming Language « IT news, forums, messages
Re: Replace the CR/LF in a textarea by str_replace

Posted by Markus Ernst on 06/07/06 09:07

boclair schrieb:
>> Why you don't use nl2br function? It will returns string with '<br />'
>> inserted before all newlines.
>
>
> Perhaps because it is incorrect syntax for other than XHTML. Apart from
> the fact that IE doesn't support it, other reasons not to use XHTML
> except for XML documents

I never heard about a case where <br /> did cause any problem... Anyway
this is still easier than regexps:

str_replace('<br />', '<br>', nl2br($text));

--
Markus

 

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

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