functions-online

preg_replace

en
de
fr

description

Searches $subject for matches to $pattern and replaces them with $replacement.

Durchsucht die Zeichenkette $subject nach Übereinstimmungen mit $pattern und ersetzt sie mit $replacement.

Analyse $subject pour trouver l'expression rationnelle $pattern et remplace les résultats par $replacement.

declaration of preg_replace

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

test preg_replace online













comments for preg_replace

On 05. Apr 2012 16:35 benjamin wrote:

hi, i have a escaped \ in my pattern: /(?

On 06. Jul 2010 11:35 niconoe wrote:

Ok, I thought like $limit was optional, you set it to -1 if NULL is post :) Happy to see that's fix for now, thanks for your great website!

On 06. Jul 2010 11:10 butzi wrote:

@niconoe: This function is working. You have to set the $limit Parameter to a proper value. As @oodavid mentioned $limit is now set to -1 by default, to avoid this problem.

more comments for preg_replace

There are some more comments for preg_replace(). To see them all click here.

+

Leave your comment