Ignore directly means ignore. in this case, the conversion error is ignored. without the ignore parameter, all strings after this character cannot be saved.
Iconv (UTF-8, gb2312 // ignore, $ data)
Ignore directly means ignore. in this case, the conversion error is ignored. without the ignore parameter, all strings after this character cannot be saved.
Conv is not the default function in the php Tutorial, but also the default installed module. Installation is required.
For Windows + php, you can modify php. ini file, remove ";" Before extension = php_iconv.dll, and copy the iconv under your original php installation file. dll to your winnt/system32
String iconv (string $ in_charset, string $ out_charset, string $ str)
When using this function for string encoding conversion, note that if UTF-8 is converted to gb2312, the string may be truncated.
You can solve this problem by using the following methods:
$ Str = iconv ('utf-8', "gb2312 // transcoder", file_get_contents ($ filepath ));
That is, add the red part in the second parameter to indicate that if the character matching the source encoding cannot be found in the target encoding, a similar character will be selected for conversion.
You can also use the: // ignore parameter to ignore characters that cannot be converted.