iconv( "UTF-8", "gb2312//IGNORE" , $FormValues['a'])
ignore means ignoring errors during conversion. It was found that iconv was converting the character "—" to gb2312 An error will occur. If there is no ignore parameter, all strings following this character cannot be saved.
In addition, mb_convert_encoding does not have this bug, so the best way to write it is:
mb_convert_encoding($FormValues['a'], "gb2312", "UTF-8");
But you need to enable the mbstring extension library first.
You can also set the collation of the mysql database to utf-8 and not use it for conversion.