mb_list_encodings
Returns all supported encoded arrays
Function name: mb_list_encodings()
Applicable version: PHP 4 >= 4.0.6, PHP 5, PHP 7
Function Description: The mb_list_encodings() function is used to return a list of all available character encodings.
Usage example:
// 获取所有可用的字符编码列表$encodings = mb_list_encodings(); // 打印字符编码列表foreach ($encodings as $encoding) { echo $encoding . "\n"; }
Example explanation:
In the above example code, we first call mb_list_encodings()
function to get all available character encoding lists and assign the result to the variable $encodings
. We then loop through the $encodings
array using foreach and print out each character encoding.
Notes:
mb_list_encodings()
function returns an array containing all available character encodings. These character encodings can be used for parameters of multibyte string processing functions such as mb_convert_encoding()
.