1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11: | $text="so bla bla [-][-][ueberschrift]Hallo[/ueberschrift][-][-]Dies ist nun der Text[-] so ein schöner Text";
function zeilen($match)
{
$vorne = str_replace("[-]", "", $match[1]);
$hinten = str_replace("[-]", "", $match[3]);
$mei = $vorne."[ueberschrift]".$match[2]."[/ueberschrift]".$hinten;
return $mei;
}
$text = preg_replace_callback("|[a-zA-Z0-9](.*)\[ueberschrift\]
(.*)\[\/ueberschrift\](.*)[A-Za-z0-9]|isU","zeilen", $text); |