Warning: Use of undefined constant hot - assumed 'hot' (this will throw an Error in a future version of PHP) in /data/wwwroot/lxy.me/wp-content/themes/Ality/inc/sticky-cat.php on line 5
在PHP中使用iconv转化字符串编码时出现错误。具体错误为:
Detected an illegal character input string
出错的语句内容为:iconv("GB2312","UTF-8",$a);
解决的方法是将GB2312换为GBK。
出现这个错误的原因是因为$a中出现了超出GB2312范围的字符,所以换用范围更广的GBK编码。问题得到解决。