[請益] 資料庫包含中文,輸出XML 亂碼
請問一下,如我資料庫裡有中文,
我知道輸出XML時,顯示會亂碼。
可是我在輸出時用了 utf8_encode ,卻沒任何改善。
以下是我原始程式,我該怎麼修改我的程式碼呢...
header("Content-type: text/xml");
// Iterate through the rows, adding XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
$node = $dom->createElement("marker");
$newnode = $parnode->appendChild($node);
$newnode->setAttribute("vName",$row['vName']);
$newnode->setAttribute("vSummary", $row['vSummary']);
$newnode->setAttribute("Add", $row['Add']);
$newnode->setAttribute("Tel", $row['Tel']);
$newnode->setAttribute("vImg1", $row['vImg1']);
$newnode->setAttribute("vLat", $row['vLat']);
$newnode->setAttribute("vLng", $row['vLng']);
}
echo $dom->saveXML();
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.46.136.139
→
09/22 00:36, , 1F
09/22 00:36, 1F
→
09/22 00:59, , 2F
09/22 00:59, 2F
→
09/22 09:14, , 3F
09/22 09:14, 3F
→
09/23 03:45, , 4F
09/23 03:45, 4F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章
151
156