What is the php utf8 conversion function?

藏色散人
Release: 2023-03-11 12:26:01
Original
1520 people have browsed it

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)".

What is the php utf8 conversion function?

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 )
Copy after login

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template