← All docs

mb_scrub()

Replaces malformed encoded units using the current substitution setting.

mb_scrub()

function mb_scrub(string $string, ?string $encoding = null): string

Replaces malformed encoded units using the current substitution setting.

Parameters:

  • $string (string)
  • $encoding (?string), default null, optional

Returns: string

Availability

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

Internals

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