faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

28 of 38 people (74%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

How to covert web input (PHP) to XML format?

Oct 31st, 2008 13:17
games games, dman, sylvain giroux, faridah hani, http://www.ttnr.org


<? 
function db2xml($host,$user,$password,$database,$table,$xml_file) 
{ 
$create_xml = fopen($xml_file,"w"); 
fwrite($create_xml,"<xml>\r\n<table>\r\n"); 
mysql_connect($host, $user, $password); 
$req = mysql_db_query($database, "select * from $table"); 
while($row = mysql_fetch_array($req)) 
{ 
fwrite($create_xml,"<element>\r\n"); 
for($j=0;$test=each($row);$j++) 
{ 
if($j%2) 
{ 
fwrite($create_xml,"<$test[0]>$test[1]</$test[0]>\r\n"); 
} 
} 
fwrite($create_xml,"</element>\r\n"); 
} 
fwrite($create_xml,"</table>\r\n</xml>"); 
fclose($create_xml); 
mysql_free_result($req); 
} 
?
http://www.f01h.com/chat/sa.html
http://www.f01h.com/chat/ue.html
http://www.f01h.com/chat/ku.html
http://www.f01h.com/chat/bh.html
http://www.f01h.com/chat/qt.html
http://www.f01h.com/chat/om.html
http://www.f01h.com/chat/er.html
http://www.f01h.com/chat/ya.html
http://www.f01h.com/chat/eg.html
http://www.f01h.com/chat/tu.html
http://www.f01h.com/chat/je.html
http://www.f01h.com/chat/mo.html
http://www.f01h.com/chat/ly.html
http://www.f01h.com/chat/jo.html
http://www.f01h.com/chat/pl.html
http://www.f01h.com/chat/so.html
http://www.f01h.com/chat/mu.html
http://www.f01h.com/chat/tr.html
http://www.f01h.com/chat/
http://www.f01h.com/chat1/ry.html
http://www.f01h.com/chat1/sh.html
http://www.f01h.com/chat1/ko.html
http://www.f01h.com/chat1/dm.html
http://www.f01h.com/chat1/eh.html
http://www.f01h.com/chat1/qt.html
http://www.f01h.com/chat1/jn.html
http://www.f01h.com/chat1/ja.html
http://www.f01h.com/chat1/ab.html
http://www.f01h.com/chat1/3s.html
http://www.f01h.com/chat1/nj.html
http://www.f01h.com/chat1/dh.html
http://www.f01h.com/chat1/ba.html
http://www.f01h.com/chat1/qr.html
http://www.f01h.com/chat1/jd.html
http://www.f01h.com/chat1/mk.html
http://www.f01h.com/chat1/md.html
http://www.f01h.com/chat1/yn.html
http://www.f01h.com/chat1/shm.html
http://www.f01h.com/chat1/jo.html
http://www.f01h.com/chat1/3r.html
http://www.f01h.com/chat1/sk.html
http://www.f01h.com/chat1/qry.html
http://www.f01h.com/chat1/tb.html
http://www.f01h.com/chat1/wa.html
http://www.f01h.com/chat1/5m.html
http://www.f01h.com/chat1/jam.html
http://www.f01h.com/chat1/qs.html
http://www.f01h.com/chat1/kr.html
http://www.f01h.com/chat1
http://www.f01h.com/
http://www.f01h.com/vb/
http://www.r4r8.com/
http://www.r4r8.com/vb/
http://www.r4r8.com/hemo1
http://www.r4r8.com/vb/archive/index.php
http://www.r4r8.com/vb/archive/index.php/f-46.html
http://www.r4r8.com/vb/archive/index.php/f-89.html
http://www.r4r8.com/vb/archive/index.php/f-45.html
http://www.r4r8.com/vb/archive/index.php/f-4.html
http://www.r4r8.com/vb/archive/index.php/f-36.html
http://www.r4r8.com/vb/archive/index.php/f-2.html
http://www.r4r8.com/vb/archive/index.php/f-3.html
http://www.r4r8.com/vb/archive/index.php/f-65.html
http://www.r4r8.com/vb/archive/index.php/f-5.html
http://www.r4r8.com/vb/archive/index.php/f-56.html
http://www.r4r8.com/vb/archive/index.php/f-7.html
http://www.r4r8.com/vb/archive/index.php/f-8.html
http://www.r4r8.com/vb/archive/index.php/f-9.html
http://www.r4r8.com/vb/archive/index.php/f-11.html
http://www.r4r8.com/vb/archive/index.php/f-14.html
http://www.r4r8.com/vb/archive/index.php/f-63.html
http://www.r4r8.com/vb/archive/index.php/f-107.html
http://www.r4r8.com/vb/archive/index.php/f-13.html
http://www.r4r8.com/vb/archive/index.php/f-105.html
http://www.r4r8.com/vb/archive/index.php/f-16.html
http://www.r4r8.com/vb/archive/index.php/f-20.html
http://www.r4r8.com/vb/archive/index.php/f-21.html
http://www.r4r8.com/vb/archive/index.php/f-35.html
http://www.r4r8.com/vb/archive/index.php/f-81.html
http://www.r4r8.com/vb/archive/index.php/f-106.html
http://www.r4r8.com/vb/archive/index.php/f-27.html
http://www.r4r8.com/vb/archive/index.php/f-28.html
http://www.r4r8.com/vb/archive/index.php/f-30.html
http://www.r4r8.com/vb/archive/index.php/f-48.html
http://www.r4r8.com/vb/archive/index.php/f-112.html
http://www.r4r8.com/vb/archive/index.php/f-111.html
http://www.r4r8.com/vb/archive/index.php/f-77.html