文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>PHP输出XML实例(是输出,不是生成)

PHP输出XML实例(是输出,不是生成)

时间:2010-10-11  来源:ayan2006

<?php
header('Content-Type: text/xml');
include"../config.inc.php";   
$obj = new dbConnection();
$sql = "select * from Union_Data order by Data_gengxintime limit 100";
$result = $obj -> Connection($sql);
$xml="";
while($arrRow = mysql_fetch_assoc($result)){
    $xml .= "<union_data>\n";
    $xml .= "<Data_id>".$arrRow["Data_id"]."</Data_id>\n";
    $xml .= "<Data_pianming>".$arrRow["Data_pianming"]."</Data_pianming>\n";
    $xml .= "<Data_bieming>金刚</Data_bieming>\n";
    $xml .= "<Data_leibie>2</Data_leibie>\n";
    $xml .= "<Data_leixing>27</Data_leixing>\n";
    $xml .= "<Data_diqu>美国</Data_diqu>\n";
    $xml .= "<Data_daoyan>导演</Data_daoyan>\n";
    $xml .= "<Data_zhuyan>主演</Data_zhuyan>\n";
    $xml .= "<Data_shouying>2006</Data_shouying>\n";
    $xml .= "<Data_pianchang>120</Data_pianchang>\n";
    $xml .= "<Data_jishu>1</Data_jishu>\n";
    $xml .= "<Data_peiyin>英语</Data_peiyin>\n";
    $xml .= "<Data_zimu>中文</Data_zimu>\n";
    $xml .= "<Data_shuoming></Data_shuoming>\n";
    $xml .= "<Data_miaoshu>描述暗暗暗暗暗暗</Data_miaoshu>\n";
    $xml .= "<Data_zhuangtai>0</Data_zhuangtai>\n";
    $xml .= "<Data_haibao>61465148.jpg</Data_haibao>\n";
    $xml .= "<Data_dianji>1</Data_dianji>\n";
    $xml .= "<Data_tuijian>1</Data_tuijian>\n";
    $xml .= "<Data_shenhe>1</Data_shenhe>\n";
    $xml .= "<Data_lurenzhe>admin</Data_lurenzhe>\n";
    $xml .= "<Data_gengxintime>2009-02-23 17:47:56</Data_gengxintime>\n";
    $xml .= "<Data_tianjiatime>2009-02-23 15:32:50</Data_tianjiatime>\n";
    $xml .= "</union_data>\n";
}
//echo $xml;
//exit;
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<data>\n";
echo $xml;
echo "</data>";
?>
文章来源:http://www.feeten.cn/html/php/05/200903190239426314836.html
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载