现有一个XML文件,是截取的用户POST的一封163邮件,内容如下:
<?xml version="1.0"?><object><string name="action">deliver</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string><object name="attrs"><string name="account">"programtest" <[email protected]></string><array name="to"><string>"programtest" <[email protected]></string></array><array name="cc"/><array name="bcc"/><string name="subject">Fw:!@#!$#@^$&%*%%:<">?>"<:"L">?>>(*&(*&(</string><string name="content"><DIV> </DIV>
<DIV> </DIV>---------- 转发邮件信息 ----------<BR>发件人:"programtest <[email protected]>" <BR>发送日期:2009-06-03 18:11:08<BR>收件人:programtest <[email protected]><BR>主题: !@#!$#@^$&%*%%:<">?>"<:"L">?>>(*&(*&(<BR>
<DIV>搜狐<A href="http://auto.sohu.com/" target=_blank><FONT color=#000099>汽车</FONT></A>讯 据美国有线电视新闻网(CNN)6月2日报道,<A href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司(General Motors Corp)就出售旗下<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>(<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>Hummer</FONT></A>)品牌已经与买方达成协议。<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司证实<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>买家为一家中国企业——总部位于成都的四川腾中重工机械有限公司(Sichuan Tengzhong Heavy Industrial Machinery Company Ltd.)。
<P> 1999年,<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>收购了<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌的所有权。作为一家民营企业,腾中重工机械有限公司表示,计划保留<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>的管理团队。腾中重工总经理杨毅表示,“在当前管<BR>><BR>:L<BR>><BR>>":>"L:<BR>:<BR>"?>">?<"<"L":>":>>":<":L":"<_)(*_(<A href="mailto:*&*%&^$#%@!#$@%E&*T*((Y">*&*%&^$#%@!#$@%E&*T*((Y</A>()*)(*_)&&&&&&&&&&&理团队的领导下,<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌将以全新的方式不断创新和增长。我们计划对<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌和产品研发能力投入资源,从而满足美国和全球市场对如高燃油效率的新产品的需求。”腾中重工表示,此交易将于今年九月底完成交割。</P></DIV><BR><BR><SPAN title=neteasefooter>
<HR>
<A href="http://qiye.163.com/?ft=3">网易企业邮,商务邮箱专家</A> </SPAN></string><boolean name="isHtml">true</boolean><int name="priority">3</int><boolean name="saveSentCopy">true</boolean><boolean name="requestReadReceipt">false</boolean><string name="charset">gbk</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string></object><int name="saveSentLimit">1</int></object>
如何用php,来处理该XML文件?
<?xml version="1.0"?><object><string name="action">deliver</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string><object name="attrs"><string name="account">"programtest" <[email protected]></string><array name="to"><string>"programtest" <[email protected]></string></array><array name="cc"/><array name="bcc"/><string name="subject">Fw:!@#!$#@^$&%*%%:<">?>"<:"L">?>>(*&(*&(</string><string name="content"><DIV> </DIV>
<DIV> </DIV>---------- 转发邮件信息 ----------<BR>发件人:"programtest <[email protected]>" <BR>发送日期:2009-06-03 18:11:08<BR>收件人:programtest <[email protected]><BR>主题: !@#!$#@^$&%*%%:<">?>"<:"L">?>>(*&(*&(<BR>
<DIV>搜狐<A href="http://auto.sohu.com/" target=_blank><FONT color=#000099>汽车</FONT></A>讯 据美国有线电视新闻网(CNN)6月2日报道,<A href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司(General Motors Corp)就出售旗下<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>(<A href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>Hummer</FONT></A>)品牌已经与买方达成协议。<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>公司证实<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>买家为一家中国企业——总部位于成都的四川腾中重工机械有限公司(Sichuan Tengzhong Heavy Industrial Machinery Company Ltd.)。
<P> 1999年,<A class=teshu href="http://jsp.auto.sohu.com/view/group-gid-240.html" target=_blank><FONT color=#000099>通用汽车</FONT></A>收购了<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌的所有权。作为一家民营企业,腾中重工机械有限公司表示,计划保留<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>的管理团队。腾中重工总经理杨毅表示,“在当前管<BR>><BR>:L<BR>><BR>>":>"L:<BR>:<BR>"?>">?<"<"L":>":>>":<":L":"<_)(*_(<A href="mailto:*&*%&^$#%@!#$@%E&*T*((Y">*&*%&^$#%@!#$@%E&*T*((Y</A>()*)(*_)&&&&&&&&&&&理团队的领导下,<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌将以全新的方式不断创新和增长。我们计划对<A class=teshu href="http://db.auto.sohu.com/brandQuery_174_1.html" target=_blank><FONT color=#000099>悍马</FONT></A>品牌和产品研发能力投入资源,从而满足美国和全球市场对如高燃油效率的新产品的需求。”腾中重工表示,此交易将于今年九月底完成交割。</P></DIV><BR><BR><SPAN title=neteasefooter>
<HR>
<A href="http://qiye.163.com/?ft=3">网易企业邮,商务邮箱专家</A> </SPAN></string><boolean name="isHtml">true</boolean><int name="priority">3</int><boolean name="saveSentCopy">true</boolean><boolean name="requestReadReceipt">false</boolean><string name="charset">gbk</string><string name="id">vBeXiLVVkVBnaSCcOmVVEwHQESYUEKHV</string></object><int name="saveSentLimit">1</int></object>
如何用php,来处理该XML文件?
直接当做html来解析吧.
用tidy_function
分就平分给大家喽。thanks。