本文介紹了在 PHP 中獲取 - 而不是撇號(')的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!
問題描述
我試過將文本轉(zhuǎn)換為 utf8 或從 utf8 轉(zhuǎn)換,這似乎沒有幫助.
I've tried converting the text to or from utf8, which didn't seem to help.
我得到:
"Ita€?s Getting the Best of Me"
應(yīng)該是:
"It’s Getting the Best of Me"
我從這個網(wǎng)址獲取這些數(shù)據(jù).
推薦答案
轉(zhuǎn)換為 HTML 實體:
To convert to HTML entities:
<?php
echo mb_convert_encoding(
file_get_contents('http://www.tvrage.com/quickinfo.php?show=Surviver&ep=20x02&exact=0'),
"HTML-ENTITIES",
"UTF-8"
);
?>
有關(guān)更多編碼選項,請參閱 mb_convert_encoding 的文檔.
See docs for mb_convert_encoding for more encoding options.
這篇關(guān)于在 PHP 中獲取 - 而不是撇號(')的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!
【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!