小弟我想加数据库 要如何加呀 小弟我不知道呀 那个给小弟我解释

WBOY
发布: 2016-06-13 13:29:30
原创
701 人浏览过

我想加数据库 要怎么加呀 我不知道呀 那个给我解释
[code=XML][/code]

 
  thumb/1.jpg  
 
 
 
  thumb/2.jpg  
 
 
 
  thumb/1.jpg  
 
 
 
  thumb/2.jpg  
 

 
  thumb/1.jpg  
 
 
 
  thumb/2.jpg  
 

 
  thumb/1.jpg  
 
 
 
  thumb/2.jpg  
 

   
   


------解决方案--------------------

PHP code
<?php $xml=<<<XML
<?xml version="1.0" encoding="utf-8"?>
<item>
  <list name="Intro something.Please custom your title text content" videotitle="Matrix film demo 1" link="video/ani1.flv">
  <thumb>thumb/1.jpg</thumb>   
  </list>   
  <list name="Intro something.Please custom your title text content" videotitle="Final matrix demo 2" link="video/ani2.flv">
  <thumb>thumb/2.jpg</thumb>   
  </list>  
  <list name="Intro something.Please custom your title text content" videotitle="Matrix film demo 1" link="video/ani1.flv">
  <thumb>thumb/1.jpg</thumb>   
  </list>   
  <list name="Intro something.Please custom your title text content" videotitle="Final matrix demo 2" link="video/ani2.flv">
  <thumb>thumb/2.jpg</thumb>   
  </list>
  <list name="Intro something.Please custom your title text content" videotitle="Matrix film demo 1" link="video/ani1.flv">
  <thumb>thumb/1.jpg</thumb>   
  </list>   
  <list name="Intro something.Please custom your title text content" videotitle="Final matrix demo 2" link="video/ani1.flv">
  <thumb>thumb/2.jpg</thumb>   
  </list>
  <list name="Intro something.Please custom your title text content" videotitle="Matrix film demo 1" link="video/ani1.flv">
  <thumb>thumb/1.jpg</thumb>   
  </list>   
  <list name="Intro something.Please custom your title text content" videotitle="Final matrix demo 2" link="video/ani1.flv">
  <thumb>thumb/2.jpg</thumb>   
  </list>
</item>
XML;
$obj=simplexml_load_string($xml);
foreach($obj->list as $v){
    $arr=(array)$v->attributes();
    $arr['@attributes']['thumb']=(string)$v->thumb;
    $list[]=$arr['@attributes'];
};
print_r($list);
 <div class="clear">
                 
              
              
        
            </div>
登录后复制
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板