开发者

PHP echo xml data

开发者 https://www.devze.com 2023-03-07 08:12 出处:网络
I have this xml file: <test time=\"11.11.20开发者_如何学Go11 11:11\" > <field type=\"one\" value=\"10\"/>

I have this xml file:

<test time="11.11.20开发者_如何学Go11 11:11" >
<field type="one" value="10"/>
<field type="two" value="10"/>
</test>

and I would like to echo in php and save into DB each 15 mins (type, value). I have cron. So the site'll look like this:

Type: one | Value: 10
Type: two | Value: 10
Time: 11.11.2011 11:11

and after 15 mins:

Type: one | Value: 10
Type: two | Value: 10
Time: 11.11.2011 11:11
Type: one | Value: 10
Type: two | Value: 10
Time: 11.11.2011 11:26

I can't find the right way to write the code, so i'm asking for your help. Thank you ;)


Try out SimpleXML: http://de2.php.net/manual/en/book.simplexml.php


You have to use the XML Parser. More info: http://www.php.net/manual/en/example.xml-structure.php

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号