← All docs

mb_ereg_replace_callback()

Replaces multibyte regex matches with the string result of a callback receiving all captures.

mb_ereg_replace_callback()

function mb_ereg_replace_callback(string $pattern, callable $callback, string $string, ?string $options = null): string|false|null

Replaces multibyte regex matches with the string result of a callback receiving all captures.

Parameters:

  • $pattern (string)
  • $callback (callable)
  • $string (string)
  • $options (?string), default null, optional

Returns: string|false|null

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how mb_ereg_replace_callback is implemented in the compiler, see the internals page.