Home > Backend Development > PHP Tutorial > 小弟我想加数据库 要如何加呀 小弟我不知道呀 那个给小弟我解释

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

WBOY
Release: 2016-06-13 13:29:30
Original
734 people have browsed it

我想加数据库 要怎么加呀 我不知道呀 那个给我解释
[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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template