php The utf8 conversion function is iconv, and the syntax for using this function is "string iconv (string in_charset, string out_charset, string str)".
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
What is the php utf8 conversion function?
string iconv ( string in_charset, string out_charset, string str )
Note: In addition to specifying the encoding to be converted to, the second parameter can also add two suffixes:
//TRANSLIT and //IGNORE, where //TRANSLIT will automatically The converted characters become one or more approximate characters. //IGNORE will ignore characters that cannot be converted, and the default effect is to truncate from the first illegal character.
Returns the converted string or FALSE on failure.
Example
GBK To UTF-8
$content = iconv("UTF-8", "GBK//IGNORE",$content);
Recommended study:《 PHP video tutorial》
The above is the detailed content of What is the php utf8 conversion function?. For more information, please follow other related articles on the PHP Chinese website!