因為 WML 只接受 UNICODE, 如果你沒有經過 convert, 你就會看到亂碼
下面 mb_convert_encoding($str, "UTF-8", "BIG-5"); 就可以把字串 convert
成 Unicode 啦
<?php
// send wml headers
header("Content-type: text/vnd.wap.wml");
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card>
<p>
<?php
$str = "哈囉";
$str = mb_convert_encoding($str, "UTF-8", "BIG-5");
print "<br/>Hello World! $str";
?>
</p>
</card>
</wml>
Tuesday, December 07, 2004
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment