... funciton mb_detect_encoding; funciton mb_convert_encoding; function mb_detect_order. 案例:. #8 回覆: [分享] 解壓縮zip檔,產生亂碼,如何解決的心得 ... ... <看更多>
mb_convert_encoding亂碼 在 [請益] 編碼的問題… - 看板PHP | PTT數位生活區 的推薦與評價
這樣執行出來後echo $ment->innertext; 所出來的會是亂碼但要是我把最上面head裡的編碼拿掉就會變中文但是echo ... 可以用mb_convert_encoding 把BIG5 轉成UTF-8. ... <看更多>
mb_convert_encoding亂碼 在 [請益] 編碼的問題… - 看板PHP 的推薦與評價
不好意思,如標題說的,小弟遇到一個轉碼的問題
想請教一下
以下為程式碼
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<?php
include('simple_html_dom.php');
$dom = file_get_html('https://na3tvilla.ttbnb.net/about.htm');
foreach($dom->find('table.abfont') as $element)
echo $element->innertext;
$dom = file_get_html('https://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
※ 文章網址: https://www.ptt.cc/bbs/PHP/M.1412152862.A.197.html
... <看更多>