2015-11-23 112 views
1

我想用PHP報廢以下網址: http://www.clubedoricardo.com.br/Produto/Smartphone-Samsung-Galaxy-Win-2-Duos-G360-Cinza-Dual-Chip-4G-Tela-45-Camera-5MP-Frontal-2MP-Quad-Core-12Ghz-8GB/44-491-496-568187刮痧HTML與PHP和編碼問題

$url="http://www.clubedoricardo.com.br/Produto/Smartphone-Samsung-Galaxy-Win-2-Duos-G360-Cinza-Dual-Chip-4G-Tela-45-Camera-5MP-Frontal-2MP-Quad-Core-12Ghz-8GB/44-491-496-568187"; 
$dom = new DOMDocument; 
$dom->loadHTMLFile($url); 
$page_content = $dom->saveHTML(); 
echo($page_content); 

但文字帶有奇怪的字符。我試着用UTF-8和ISO-8859編碼,但沒有任何變化。

任何想法?

回答

0

當我按照您提供的鏈接出現空白網站時。 Try:

$dom->loadHTML(mb_convert_encoding($url, 'HTML-ENTITIES', 'UTF-8')); 
+0

對不起,我現在修復了網址。我應該嘗試「loadHTML」還是「loadHTMLFile」? – Cleuson