uhm ... prova cosi'
codice:$testo = " [ QUOTE] test1 [ QUOTE] test2 [/QUOTE] test3 [/QUOTE] "; function blockParser( $reg, $rep, &$block ) { if( ( $match = preg_match( $reg, $block ) ) ) { $block = preg_replace( $reg, $rep, $block ); } if( $match ) { blockParser( $reg, $rep, $block ); } } blockParser( "/(?iU)(\[QUOTE\])([^\\1]+?)(\[\/QUOTE\])/", "<div>\\2</div>", $testo ); echo $testo;


Rispondi quotando