Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] nl2br
kubal
post
Post #1





Grupa: Zarejestrowani
Postów: 47
Pomógł: 1
Dołączył: 17.06.2008
Skąd: się bierze ten lubieżny uśmiech na Twojej twarzy?

Ostrzeżenie: (0%)
-----


Witam (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

Mam u mnie w newsach użyte funkcji nl2br ($s = nl2br($text); ), ale piszę stronę w html'u a nie w xhtml'u (IMG:http://www.forumweb.pl/images/smiles/icon_wink.gif) i ta funkcja daje takie <br/> ;/ a powinno wyglądać ono tak <br> bo wywala ostrzeżenie w validatorze.
Co zrobić aby działało to tak jak chce.?

Pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

Ten post edytował kubal 3.11.2008, 16:13:21
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Virti
post
Post #2





Grupa: Zarejestrowani
Postów: 115
Pomógł: 12
Dołączył: 11.01.2005
Skąd: Zduńska Wola

Ostrzeżenie: (0%)
-----


ehh czytanie manuala:

Rejestr zmian
Wersja Opis
5.3.0 Added the optional is_xhtml parameter. 
4.0.5 nl2br() is now XHTML compliant. All older versions will return string with '<br>' inserted before newlines instead of '<br />'.





czyli masz php nowsze niż 4.0.5 a starsze niż 5.3.0...

str_replace" title="Zobacz w manualu PHP" target="_manual



Pozdrawiam (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)

Ten post edytował Virti 3.11.2008, 16:35:12
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 4.10.2025 - 04:54