欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  web前端

js ajax经典实例之解析xml

程序员文章站 2022-05-27 15:38:19
...
test.php文件代码如下:



js ajax经典实例之解析xml



xml.php文件代码如下:

"张三","age"=>"16","weight"=>"50","height"=>"160"),
    array("name"=>"李四","age"=>"17","weight"=>"51","height"=>"165"),
    array("name"=>"王二","age"=>"18","weight"=>"55","height"=>"170"),
    array("name"=>"javior","age"=>"20","weight"=>"68","height"=>"179")
);
$xml="";
$xml.="";
foreach($arr as $k=>$v){
    $xml.="";
    $xml.="".$v["name"]."";
    $xml.="".$v["age"]."";
    $xml.="".$v["weight"]."";
    $xml.="".$v["height"]."";
    $xml.="";
}
$xml.="";
echo $xml;
?> 
相关标签: ajax xml 解析