Benvenuto Posted February 11, 2004 Report Share Posted February 11, 2004 Manam necilajam saitam ir taada probleema, ka ENTER tiek komentaaros repleisots ar <br>, bet biezhi vien komenteetaajs sava komentaara beigaas uztaisa lieku jaunu rindinju un tad beigaas pievienojas <br>. liidz ar to lapa neizskataas diez cik kaartiigi ar shaadaam atstarpeem dazhu komentaaru beigaas. kaa buutu iespeejams veikt taadu lietu, ka, ja peec enter nospieshanas nekas vairs nav rakstiits, tad to nenjem veeraa? ceru ka neizteicos paaraak samudzhinati... Link to comment Share on other sites More sharing options...
Robis Posted February 11, 2004 Report Share Posted February 11, 2004 Paraadi to kodu, kas replaco enterus ar <br> un es pateikshu kaa to izdariit!!! Link to comment Share on other sites More sharing options...
Gacha Posted February 11, 2004 Report Share Posted February 11, 2004 Izvadot datus no datubaazes pieliec shaadu rindinju: $komentari = nl2br($komentaari); Tur kur lietotaajs buus nospiedis enter paraadiisies jaunaa rindaa. Nav jaizmanto <br> Link to comment Share on other sites More sharing options...
Robis Posted February 11, 2004 Report Share Posted February 11, 2004 :) tas neatrisina probleemu :) Link to comment Share on other sites More sharing options...
Benvenuto Posted February 11, 2004 Author Report Share Posted February 11, 2004 Paraadi to kodu, kas replaco enterus ar <br> un es pateikshu kaa to izdariit!!! $mainiigais = preg_replace("/(\r\n|\n|\r)/", "<br>", $mainiigais1); shito protams pats neizdomaaju bet kaukur ievilku naasiis. Link to comment Share on other sites More sharing options...
Gacha Posted February 11, 2004 Report Share Posted February 11, 2004 Vai! isti neizlasiju beigas. Link to comment Share on other sites More sharing options...
Kaklz Posted February 11, 2004 Report Share Posted February 11, 2004 (edited) Manam necilajam saitam ir taada probleema, ka ENTER tiek komentaaros repleisots ar <br>, bet biezhi vien komenteetaajs sava komentaara beigaas uztaisa lieku jaunu rindinju un tad beigaas pievienojas <br>. liidz ar to lapa neizskataas diez cik kaartiigi ar shaadaam atstarpeem dazhu komentaaru beigaas.kaa buutu iespeejams veikt taadu lietu, ka, ja peec enter nospieshanas nekas vairs nav rakstiits, tad to nenjem veeraa? ceru ka neizteicos paaraak samudzhinati... http://3a3-interactive.net/blog.php/post/2003/10/19/68/ Edited February 11, 2004 by Kaklz Link to comment Share on other sites More sharing options...
Robis Posted February 11, 2004 Report Share Posted February 11, 2004 Man ieteikums, izmantot preg_replace, respektīvi, ja strings beidzas ar <br />, tad tas <br /> ir jaaizvieto ar "" (NEKO) un lai nodzeestu vairaakus <br /> tas ir jaaieliek ciklaa liidz strings vairs nebeidzas ar <br />, šajā ciklā vēl jābūt stripslashes funckijai, kas notiek peec <br /> aizvietošanas ar tukšumu, lai izvairītos arī no šādām liekībām. Lūk, es piedāvāju šādu interesantu variantu: for ($i=0; $i <1000; $i++) { $comments1 = $comments; $comments = preg_replace("/(.+?)\<br />/", "", $comment); $comments = stripslashes($comments); $comments2 = $comments; if ($comments1 == $comments2) { $i = 999; } } :) Link to comment Share on other sites More sharing options...
Roze Posted February 11, 2004 Report Share Posted February 11, 2004 ghmm a kas vainas trim() http://lv.php.net/trim nl2br(trim($komentars)) ? prieksh kam bloated preg_repleisus slash striposhanu un hvz veel ko Link to comment Share on other sites More sharing options...
Benvenuto Posted February 11, 2004 Author Report Share Posted February 11, 2004 Paldies par ieteikumiem, es riit pameegjinaashus piedaavaatos variantus un uzrakstiishu kaa man veicaas. fiksi uzmetot aci trim izskataas ceriigi. Shovakar vairs galiigi nav speeka kaut ko dariit. Link to comment Share on other sites More sharing options...
Benvenuto Posted February 14, 2004 Author Report Share Posted February 14, 2004 ghmm a kas vainas trim() http://lv.php.net/trim nl2br(trim($komentars)) ? prieksh kam bloated preg_repleisus slash striposhanu un hvz veel ko perfekti. tieshi tas kas vajadziigs. paaa-aaldies. Link to comment Share on other sites More sharing options...
Recommended Posts