Skip to main content

Command Palette

Search for a command to run...

PHP preg_replace_callback

Published
1 min readView as Markdown

(PHP 4 >= 4.0.5, PHP 5, PHP 7, PHP 8)

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

Description ¶

preg_replace_callback ( string|array $pattern , callable $callback , string|array $subject , int $limit = -1 , int &$count = null , int $flags = 0 ) : string|array|null
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.

More from this blog

Khang Nguyen

119 posts