Home > PHP > Function > PCRE > preg_replace_callback()

preg_replace_callback()

preg_replace_callback - Perform a regular expression search and replace using a callback

Syntax

mixed preg_replace_callback ()

Arguments

-

Description

The behavior of this function is almost identical to preg_replace(), except for the fact that instead of replacement parameter, one should specify a callback.

Version

PHP 4.0.5, 5

Return value

preg_replace_callback() returns an array if the subject parameter is an array, or a string otherwise. On errors the return value is NULL