PHP preg_replace_callback() Function

PHP preg_replace_callback() Function


The preg_replace() function is a built-in function of PHP. It is used to perform a regular expression search and replace.

This function searches for pattern in subject parameter and replaces them with the replacement.

Syntax

  1. preg_replace (mixed $pattern, mixed $replacement, mixed $subject, int $limit, int $count)  

Parameters

This function accepts five parameters, which are described below: