xml解析問題 - PHP / 基础编程
為什麼我生成的時候是big5編碼的xml,但我解析之後卻發現xml內容的編碼蠻成了utf-8的,這是為什麼
<?xml version='1.0' encoding='big5' ?>
<editorial>
<header>
</header>
<body>
<title_1>Greenhouse</title_1>
<subheading_1>A New Experience</subheading_1>
<paragraph_1><p>虎鼐睦 小起碼企載睦 孕地大</p></paragraph_1>
</body>
</editorial>
這是我生成的xml文件
function hookHome($params)
{
if (file_exists('modules/editorial/editorial.xml'))
{
if ($xml = simplexml_load_file('modules/editorial/editorial.xml'))
{
global $cookie, $smarty;
$smarty->assign(array(
'xml' => $xml,
'homepage_logo' => file_exists('modules/editorial/homepage_logo.jpg'),
'logo_subheading' => 'logo_subheading_'.$cookie->id_lang,
'title' => 'title_'.$cookie->id_lang,
'subheading' => 'subheading_'.$cookie->id_lang,
'paragraph' => 'paragraph_'.$cookie->id_lang,
'this_path' => $this->_path
));
return $this->display(__FILE__, 'editorial.tpl');
}
}
return false;
}
這是解析xml文件 display方法無關
相关问答:
Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' 打开刚创建的文件。
ReDim MyString(LOF(1) - 1)
Put #1, , MyRecord ' 读入所有字符到变量中 ......
请教高手帮忙,session_start()放在外部的文件用 require 或 include 包含进来,请问这样做合理吗??代码运行是正常的,这样做合理吗??请高手指点。。。。 谢谢····
require 或 include ......
急求:在php脚本里怎么调用js文件里方法?
或者在js文件里调用php文件写的seesion?
PHP刚入门学习,友情顶一个
急求:在php脚本里怎么调用js文件里方法?
//echo '<script>alert("ok");< ......
使用网上的 phpexcelreader 类,将虚拟机内存调整值1024M,excel体积为224M,用phpexcelreader读取的时候内存根本不够用,请教各位有什么好的方法读取这种大体积的 excel 问价么?
excel体积为224M
服了。。。 ......
php中如何输出千分位分隔符。。。。。
number_format
PHP code:
//是这种效果吧?
echo number_format(123123123, 2, '.', ',');
//结果输出123,123,123.00 2是小数点后位数,第三个参数是小数点分隔符 ......