mb_check_encoding — Check whether the string is valid in the specified encoding
PHP version requirements: (PHP 4 >= 4.4.3, PHP 5 >= 5.1.3)
Description: bool mb_check_encoding ([ string $var = NULL [, string $encoding = mb_internal_encoding() ]] )
Check whether the specified byte stream is valid in the specified encoding. It can effectively avoid the so-called "Invalid Encoding Attack".
Parameters
var
The byte stream to check. If this parameter is omitted, this function checks all input from the original request.
encoding
The desired encoding.
Return Value
Returns TRUE on success, or FALSE on failure.
In order to check if a string is correctly encoded in UTF-8, I suggest the following function to implement mb_check_encoding(): 🎜>
http: //www.bkjia.com/PHPjc/825083.html