| | |
| Stránka: 1 z 1
| [ Príspevkov: 5 ] | |
Autor | Správa |
---|
Registrovaný: 09.09.07 Prihlásený: 07.11.16 Príspevky: 3114 Témy: 233 Bydlisko: Nové Zámky |
Zdravim,
ako by som vedel zmazat z BB kodu vsetky citacie, to znamena vsetky Kód: [quote][/quote] a vsetok text medzi nimi. Jednoducho, na phpBB fore kompletne z prispevku odstranit citacie.. Skusam vselijako, ale viem zmazat len 1 uroven.. taketo: Kód: [quote][quote]fsfsf[/quote]sfsfs[/quote]
uz mi nejde..
Ako by ste to spravili? dik
_________________ "It took a lot of work, but this latest Linux patch enables support for machines with 4096 CPUs, up from the old limit of 1024." "Do you have support for smooth full-screen flash video yet?" "No, but who uses that?"
- ak dlho neodpisujem do témy, zabudol som na ňu, takže ma upozornite SS, ak chcete moju odpoveď |
|
Registrovaný: 25.12.10 Prihlásený: 30.05.23 Príspevky: 94 Témy: 21 Bydlisko: Pezinok |
Kód: <?php $str = 'abcd [quote][quote]test2[/quote]test3[/quote]jenp'; $level = 0; $offset = 0; $result = '';
while($offset < strlen($str)) { $c = substr($str, $offset, 1); switch($c) { case '[': if(substr($str, $offset, 7) == '[quote]') { $level += 1; $offset += 7;//strlen('[quote]') } if(substr($str, $offset, 8) == '[/quote]') { $level -= 1; $offset += 8;//strlen('[/quote]') } break; default: ++$offset; if($level == 0) $result .= $c; } } echo $result; ?>
|
|
Registrovaný: 09.09.07 Prihlásený: 07.11.16 Príspevky: 3114 Témy: 233 Bydlisko: Nové Zámky |
pri dlhsich prispevkov to trva cca minutku, kym sa to spravi
_________________ "It took a lot of work, but this latest Linux patch enables support for machines with 4096 CPUs, up from the old limit of 1024." "Do you have support for smooth full-screen flash video yet?" "No, but who uses that?"
- ak dlho neodpisujem do témy, zabudol som na ňu, takže ma upozornite SS, ak chcete moju odpoveď |
|
Registrovaný: 16.05.07 Prihlásený: 01.08.17 Príspevky: 837 Témy: 6 | Napísal juho: 13.07.2011 8:01 | |
|
skus kolko bude trvat todto Kód: <?php $str = 'abcd [quote][quote]test2[/quote]test3[/quote]jenp'; function zmen($str) { return preg_replace("/\[quote\][^[]*\[\/quote\]/",'',$str); } while($str!=zmen($str))$str=zmen($str); echo $str; ?> sice v podstate by to malo byt to iste ale tak mozno to skompilovana funkcia urychli a hadam to nebude trvat dlhsie
|
|
Registrovaný: 09.09.07 Prihlásený: 07.11.16 Príspevky: 3114 Témy: 233 Bydlisko: Nové Zámky |
To vyzera, ze ide vcelku rychlo Dik moc
_________________ "It took a lot of work, but this latest Linux patch enables support for machines with 4096 CPUs, up from the old limit of 1024." "Do you have support for smooth full-screen flash video yet?" "No, but who uses that?"
- ak dlho neodpisujem do témy, zabudol som na ňu, takže ma upozornite SS, ak chcete moju odpoveď |
|
| Stránka: 1 z 1
| [ Príspevkov: 5 ] | |
| Nemôžete zakladať nové témy v tomto fóre Nemôžete odpovedať na témy v tomto fóre Nemôžete upravovať svoje príspevky v tomto fóre Nemôžete mazať svoje príspevky v tomto fóre
|
|