Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

To file xml vi PHP

Cho c nh! Hin ti mnh ang mun to playlist chay flv, nhung mnh ti v n chy dng xml.By gi mnh c nh hng dn gip mnh v c cch to csdl nh theo mu: <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <link>http://www.longtailvideo.com</link> <item> <title>Big Buck Bunny - FLV Video</title> <description>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</description> <media:credit role="author">the Peach Open Movie Project</media:credit> <media:content url="http://www.longtailvideo.com/jw/upload/bunny.flv" type="video/x-flv" duration="33" /> </item> <item> <title>Big Buck Bunny - FLV Video</title>

<description>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundation's previous film Elephants Dream, the film is made using free and open source software.</description> <media:credit role="author">the Peach Open Movie Project</media:credit> <media:content url="http://www.longtailvideo.com/jw/upload/bunny.flv" type="video/x-flv" duration="33" /> </item> <item> <title>Big Buck Bunny - FLV Video</title>

<description>Big Buck Bunny is a short animated film by the Blender Institute, part of the Blender Foundation. Like the foundations previous film Elephants Dream, the film is made using free and open source software.</description> <media:credit role="author">the Peach Open Movie Project</media:credit> <media:content url="http://www.longtailvideo.com/jw/upload/bunny.flv" type="video/x-flv" duration="33" /> </item> </channel> </rss>

Quote

29-03-2011 09:20#2

kiem_bo
Registered User Tham gia 06-03-2007 Bi vit 541 Like 0 Thanked 1 Time in 1 Post

trc tin bn to 1 file php v d createxml.php Khi truyn link http://yourdomain.com/create.xml?id=1

id=1 l id ca list khi bn truy vn ly thng tin playlist gn v bin playlist Code:
header ("content-type: text/xml"); echo '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/"> <channel> <link>http://www.longtailvideo.com</link> '; if(isset($playlist[0])) foreach($playlist as $kpl =>$vpl): echo '<item> <title>'.$vpl['title'].'</title> <description>'.$vpl['description'].'</description> <media:credit role="author">'.$vpl['author'].'</media:credit> <media:content url="'.$vpl['url_video'].'" type="video/x-flv" duration="33" /> </item>'; endforeach; </channel> </rss>

Link: http://www.ddth.com/showthread.php/531818-T%E1%BA%A1o-file-xml-v%E1%BB%9Bi-PHP#ixzz1nsyqRbS5

You might also like