Braiens Posted November 10, 2004 Report Share Posted November 10, 2004 Kāds luudzu nevar uzrakstiit kas bija jaraksta lai nelauj komentos iepostot html kodu, lai Enter pogas spiediens parveshas par <br /> Link to comment Share on other sites More sharing options...
lamerz Posted November 10, 2004 Report Share Posted November 10, 2004 /*apgriezam garos vardus */ $text = wordwrap($text, 20, "<br />"); /*iznemsim laukaa no texta html tegus */ $text = strip_tags($text, '<a><b><i><u>'); /* ar sho textarea nospiestos enter parveidojam par tegu <br> */ $text=ereg_replace("\n","<br>",$text) /* ar sho apgriezisham garo textu */ $text=substr($text,0, 4000) Link to comment Share on other sites More sharing options...
Braiens Posted November 10, 2004 Author Report Share Posted November 10, 2004 tnx Link to comment Share on other sites More sharing options...
Venom Posted November 11, 2004 Report Share Posted November 11, 2004 strip_tags() vietā var lietot htmlspecialchars(), lai tagu stringi atrādītot tieši kā uzrakstīti (<script> tiks pārveidots par <script>, tā kā šeit forumā) Link to comment Share on other sites More sharing options...
bubu Posted November 11, 2004 Report Share Posted November 11, 2004 ar ko $text=ereg_replace("\n","<br>",$text) ir labāks par $text=nl2br($text) vai $text= str_replace("\n", "<br>", $text); ? Link to comment Share on other sites More sharing options...
Kaklz Posted November 11, 2004 Report Share Posted November 11, 2004 ar ko $text=ereg_replace("\n","<br>",$text) ir labāks par $text=nl2br($text) vai $text= str_replace("\n", "<br>", $text); ? kamēr ereg_replace darbojas, var paspēt aiziet padzert tēju un apēst kādu desmaizi. ar otrajiem diviem ir grūti - tie maitas pārāk ātri strādā :D :lol: :P :P Link to comment Share on other sites More sharing options...
bubu Posted November 11, 2004 Report Share Posted November 11, 2004 Tas bija jautājums autoram, lai būtu viela pārdomām. Nevis tev, desmaižu rijējam ;) Link to comment Share on other sites More sharing options...
Recommended Posts