Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php/regex] - Usuniecie czesci kodu - problem z nl
pieto
post
Post #1





Grupa: Zarejestrowani
Postów: 227
Pomógł: 1
Dołączył: 12.05.2002
Skąd: gdańsk

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


Witam, mam taki problem usuwam sobie cześć kodu ze zmiennej np

$content=preg_replace( '%\[\[kw:(.*?)\]\]%e', '', $content );, oczywiscie usuwa mi wszystko co jest w [[kw..]] ale problem jest w tym ze przy wyswietlaniu zmiennej z nl2br
zamienia mi to na jakby <br>, a moze jakas propozycja by zlikwidowac ten odstęp (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
pieto
post
Post #2





Grupa: Zarejestrowani
Postów: 227
Pomógł: 1
Dołączył: 12.05.2002
Skąd: gdańsk

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


Nie no juz więcej nic konkretnego nie ma w kodzie tylko usuwanie niepotrzebnych smieci np:

$content=preg_replace( '%\[\[af:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[da:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[de:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ca:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[et:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[en:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[fr:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[it:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[he:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[hu:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[nl:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[no:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[pt:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[es:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[eo:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[fy:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ja:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ro:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ru:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[fi:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[sv:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[zh:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[gl:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ko:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[nr:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[la:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[bg:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[hr:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[fa:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[scn:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[lb:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[uk:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[cs:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ld:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[id:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[lt:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[nn:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[nds:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[simple:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[sl:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[tl:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[tr:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[cy:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[zh-cn:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[io:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ang:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ar:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ms:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[is:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[tt:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[vi:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ur:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[wa:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[bs:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[el:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ia:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[yo:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[msg:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ast:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[mi:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[be:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[eu:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ea:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[sk:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[it:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[gd:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[lt:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[lv:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[minnan:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[oc:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[ga:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[sr:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[als:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[su:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[an:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[hi:(.*?)?\]\]%e', '', $content );
$content=preg_replace( '%\[\[sw:(.*?)]\]%e', '', $content );
$content=preg_replace( '%\[\[nah:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[csb:(.*?)]\]%e', '', $content );
$content=preg_replace( '%\[\[ku:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[ml:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[zh-tw:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[ie:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[li:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[se:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[sa:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[th:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[kw:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[rm:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[nb:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[zh-min-nan:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[az:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[na:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[tokipona:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[tpi:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[br:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[co:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[jbo:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[mk:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[sq:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[fur:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[ta:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[kn:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[ks:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[bn:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[kn:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[fo:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[roa-rup:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[yi:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[vo:(.*?)\]\]%e', '', $content );
$content=preg_replace( '%\[\[bi:(.*?)\]\]%e', '', $content );

itede, po przetworzeniu pojawiaja sie ne potrzebne przerwy w tekscie (echo stripslashes(nl2br($content))(IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) , bo wychodzi na to ze zamienia to na "entery" grrr .
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: 26.12.2025 - 20:26