[請益] 編碼的問題…
不好意思,如標題說的,小弟遇到一個轉碼的問題
想請教一下
以下為程式碼
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<?php
include('simple_html_dom.php');
$dom = file_get_html('http://na3tvilla.ttbnb.net/about.htm');
foreach($dom->find('table.abfont') as $element)
echo $element->innertext;
$dom = file_get_html('http://na3tvilla.ttbnb.net/about.htm');
foreach($dom->find('title') as $ment)
echo $ment->innertext;
?>
這樣執行出來後 echo $ment->innertext; 所出來的會是亂碼
但要是我把最上面 head裡的編碼拿掉 就會變中文
但是 echo $element->innertext; 所出來的就會變亂碼…
這該怎麼解決呢 ??
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.51.223.4
※ 文章網址: http://www.ptt.cc/bbs/PHP/M.1412152862.A.197.html
推
10/01 17:00, , 1F
10/01 17:00, 1F
→
10/01 17:11, , 2F
10/01 17:11, 2F
→
10/01 17:11, , 3F
10/01 17:11, 3F
推
10/01 19:23, , 4F
10/01 19:23, 4F
推
10/01 19:40, , 5F
10/01 19:40, 5F
→
10/01 22:40, , 6F
10/01 22:40, 6F
推
10/02 08:35, , 7F
10/02 08:35, 7F
→
10/02 08:36, , 8F
10/02 08:36, 8F
→
10/02 08:36, , 9F
10/02 08:36, 9F
→
10/02 16:44, , 10F
10/02 16:44, 10F
推
10/02 21:13, , 11F
10/02 21:13, 11F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章