ÎÞ·¨µ¼³öΪxml - PHP / »ù´¡±à³Ì
PHP code:
/**
* µ¼³öxmlÎļþ
*/
class XmlExport extends FileExport{
/**
* µ¼³öÎļþ·½·¨
*/
public function downFile($data){
header('content-Type: text/xml');
header('content-Disposition:attachment;filename='.$this->fileName);
header('Accept-Ranges:bytes');
header('Pragma:no-cache');
header('Expires:0');
if (count($data)<=0){
echo 'No Data !'.chr(13);
}
$content = '<?xml version="1.0" encoding="UTF-8" ?>'.chr(9).chr(13);
foreach ($data as $k => $v){
/**
* ÿÐеÄÊä³öÊý¾Ý
*/
$content .= chr(9).'<data>'.chr(13);
foreach($v as $kk => $vv){
$content .= chr(9).chr(9).'<'.$this->changeEncodeToGB2312($kk).'>'
.$this->changeEncodeToGB2312($vv).'<'
.$this->changeEncodeToGB2312($kk).'/>'.chr(13);
}
$content .= chr(9).'</data>'.chr(13);
}
echo $content;
}
}
ûÓе¯³öÏÂÔØ¶Ô»°¿ò£¬Ö±½Ó°ÑÄÚÈÝÏÔʾÔÚä¯ÀÀÆ÷ÀïÃæÁË£¬´ó¼Ò°ïæ¿´¿´
ÎÊÌâÕÒµ½ÁË£¬×Ô¼ºÌ«´ÖÐÄ¡£
PHP code
Code highlighting produced by Actipro CodeHighlighter (fre
Ïà¹ØÎÊ´ð£º
DataSetµ¼³öxml Åú´¦Àí(Ñ»·)µÃÔõô´¦Àí
XMLÎļþ
<A>
<B>
<C>
</C>
&nb ......
´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......
ĿǰÔÚÎ人ÕÒ¹¤×÷
·¢Ïִ󲿷ֹ«Ë¾ÎÞÍâºõÁ½ÖÖ
Ò»ÖÖÊǸãÍâ°üµÄ ÒªÓÃzend,cakephpµÈÍâ¹ú¿ò¼Ü
»¹ÒªÊìϤÍâ¹ú¿ªÔ´ÏµÍ³
Ò»ÖÖ¹úÄÚµÄ ÎÞÍâºõ dedecms ecshop shopexÕ⼸ÖÖ¸ÄÕ¾µã ÓеĹ«Ë¾ÉõÖÁÄÃһЩ¸üСµÄϵͳ¸ ......
Çë½Ì¸ßÊÖ°ïæ£¬session_start£¨£©·ÅÔÚÍⲿµÄÎļþÓà require »ò include °üº¬½øÀ´£¬ÇëÎÊÕâÑù×öºÏÀíÂ𣿣¿´úÂëÔËÐÐÊÇÕý³£µÄ£¬ÕâÑù×öºÏÀíÂ𣿣¿Çë¸ßÊÖÖ¸µã¡£¡£¡£¡£ лл····
require »ò include ......