mb_scrub

Replace ill-formed byte sequences with the substitute character

&reftitle.description; `string` `mb_scrub` `string` `string` ``string``null```encoding`&null;

Perform a character set conversion from the specified encoding, or the default encoding if no encoding was specified, to the same encoding. This has the effect of replacing any invalid byte sequences with the substitute character.

&reftitle.parameters;

`string`

- The input string.

`encoding`

- The encoding used to interpret `string`. If it is omitted or &null;, the mbstring.internal_encoding setting will be used if set, otherwise the default_charset setting will be used.

&reftitle.returnvalues;

The &string; result with invalid byte sequences replaced.

&reftitle.changelog;

&Version; | &Description;
&mbstring.changelog.encoding-nullable;