How to convert any character encoding to UTF8 on PHP

后端 未结 3 797
无人共我
无人共我 2021-01-06 09:06

I\'m working on a web crawler that grabs data from sites all over the world, and is dealing with distinct languages and encodings.

Currently I\'m using the following

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-06 10:06

    You can try utf_encode($str).

    http://www.php.net/manual/en/function.utf8-encode.php#89789

    Or you can replace the content type meta tag with

     
    

    from header of crawled content

提交回复
热议问题