遇到乱码问题,弄了半天原来是语句iconv("cp1252","UTF-8",$content); 本身的问题
在参考了php.net的手册里的iconv函数后发现下面有人留言说iconv("cp1252","UTF-8",$content); 有点小毛病,http://php.oregonstate.edu/manual/en/function.iconv.php
可以用以下方法实现cp1252转成UTF-8的功能:
$content=htmlentities(file_get_contents($match_info_link), ENT_QUOTES, "Windows-1252");
$content=html_entity_decode($content, ENT_QUOTES , "utf-8");