开发者

How do I load a xml file with PHP? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Best XML Parser for PHP

I h开发者_如何学Cave an XML code like as given below

<response-code>100</response-code>

<tktname>m1318049ebc11833623372</tktname>

<abc-id>1237829</abc-id>

I want to fetch the tktname from the XMl using PHP


What about http://www.php.net/manual/en/simplexml.examples-basic.php?


$xml = new SimpleXMLElement('<test>'.$yourcode.'</test>');
print $xml->tktname;


You want to use xml_parse to create your own parser: http://www.php.net/manual/de/intro.xml.php. xml_parse is part of php so it's likely to be installed even on shared hoster. Or you want to use DOM-XML a php extension: http://www.php.net/manual/en/book.domxml.php

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜