跳转到主要内容

mb-check-encoding

mb_check_encoding

Check if strings are valid for the specified encoding

ENTITY

bool

mb_check_encoding

array

string

null

value

ENTITY

string

null

encoding

ENTITY

Checks if the specified byte stream is valid for the specified encoding. If value is of type ENTITY, all keys and values are validated recursively. It is useful to prevent so-called "Invalid Encoding Attack".

ENTITY

value
The byte stream or ENTITY to check. If it is omitted, this function checks all the input from the beginning of the request.

[!WARNING] As of PHP 8.1.0, omitting this parameter or passing ENTITY is deprecated.

encoding
The expected encoding.

ENTITY

ENTITY

ENTITY ENTITY

ENTITY

ENTITY ENTITY
8.1.0 Calling this function with ENTITY as value or without argument is deprecated.
8.0.0 value and encoding are nullable now.
7.2.0 This function now also accepts an ENTITY as value. Formerly, only ENTITYs have been supported.