file_get_contents() Breaks Up UTF-8 Characters
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: $html = file_get_contents('http://example.com/foreign.html'); How can I solve this? UPDATE: I tried both saving the HTML to a file and outputting it with UTF-8 encoding. Both doesn't work so it means file_get_contents() is already returning broken HTML. UPDATE2: Test 回答1: I had similar problem with polish language I tried: $fileEndEnd = mb_convert_encoding($fileEndEnd, 'UTF-8', mb_detect_encoding($fileEndEnd, 'UTF-8', true)); I tried: $fileEndEnd = utf8_encode ( $fileEndEnd ); I tried: $fileEndEnd = iconv( "UTF-8", "UTF-8", $fileEndEnd );