preg_replace

preg_replace -- Perform a regular expression search and replace

Description

mixed preg_replace ( mixed pattern, mixed replacement, mixed subject [, int limit])

Anmerkung : When working with a replacement pattern where a backreference is immediately followed by another number ( i.e. : placing a literal number immediately after a matched pattern) , you cannot use the familiar \\1 notation for your backreference . \\11 , for example , would confuse preg_replace( ) since it does not know whether you want the \\1 backreference followed by a literal 1 , or the \\11 backreference followed by nothing .

Beispiel 1 .






Anmerkung :

Beispiel 2 .






Beispiel 3 .




This example will produce:



Beispiel 4 .




Beispiel 5 .










Anmerkung :