那是我的php代码;
//Encode ANSI
function donustur($str){
$eski = array('Ç', 'Ş', 'Ğ', 'Ü', 'İ', 'Ö', 'ç', 'ş', 'ğ', 'ü', 'ö', 'ı', ' ','&');
$yeni = array('c', 's', 'g', 'u', 'i', 'o', 'c', 's', 'g', 'u', 'o', 'i', '-','&');
return str_replace($eski,$yeni,$str);
}
header('Content-type: text/xml');
echo "<?xml version=\"1.0\" encoding=\"ISO8859-9\" ?>\n";
echo "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">";
echo "<url>
<loc>http://www.sitem.com/</loc>
<changefreq>daily</changefreq>
</url>";
$d = "\t<changefreq>daily</changefreq>\n";
$kategoriCek = mysql_query("SELECT * FROM kategoriler");
while($kat = mysql_fetch_array($kategoriCek)){
echo "<url>\n";
echo "\t<loc>http://www.sitem.com/".$kat['id']."-".donustur(strtolower($kat['kategoriadi']))."-kategori.html</loc>\n";
echo $d;
echo "</url>\n";
}
echo "</urlset>\n";
输出;
<loc>http://www.sitem.com/93-??-guvenl?k-kategori.html</loc>
我想要的应该是这样的;
<loc>http://www.sitem.com/93-is-guvenlik-kategori.html</loc>
UTF-8 和 UTF-8 不是 BOM 或encoding="ISO8859-9",encoding="UTF-8"不起作用。
我们怎么解决?
感谢您的关注。干得好..