WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   nl2br - php (http://www.wcm.at/forum/showthread.php?t=158083)

suRe 07.02.2005 09:31

nl2br - php
 
hei leude, ich möchte aus meiner DB die news auslesen und die \n in br's umwandeln.

nun hier mein code:

PHP-Code:

     echo "<tr>";
      echo 
"<td colspan=2 bgcolor=#ffffff> 

 [b] $news [/b] </p> </td>"
;
     echo 
"</tr>"

kann mir da wohl jemand kurz einen tipp geben?

FordPrefect 07.02.2005 12:40

mach es doch einfach so:
PHP-Code:

$news=ml2br($news); 

lg Peter

AlexanderFX 07.02.2005 14:34

entweder
Code:

SELECT replace(spalte,'\n','
') as ...

oder
PHP-Code:

 $news=nl2br($news); 

mfg
alex

suRe 10.02.2005 14:51

yes danke jungs hat gefunzt.... ich halbschlauer habs nur falsch aufebaut :)

tnx

AlexanderFX 10.02.2005 14:53

:D

btw. funktion liste von php.net hilft acuh gerne =D

http://de.php.net/manual/de/function.nl2br.php


Alle Zeitangaben in WEZ +2. Es ist jetzt 02:16 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag