suit: preg_replace, Teilstring einsetzen

Beitrag lesen

Die Suchergebnisse stehen dir im Replacement zur verfügung (0 ist alles, 1 ist das erste Subpattern usw) - steht in der Dokumentation ;)

bist Du gerade bei preg_match? Der OP hat preg_replace verwendet.

Nein, ich bin schon bei preg_replace:

2. Argument: replacement; may contain references of the form \n or [...] $n; n can be from 0 to 99, and [0] refers to the text matched by the whole pattern. Opening parentheses are counted from left to right (starting from 1) to obtain the number of the capturing subpattern.