开发者

PHP: newbie question - parse xml from string?

i've googled and found several php extensions for php so i was wondering: is there already a built-in support for parsing xml in php?

i'd like to convert my projects from asp to php - i got xml data stored in a database - so i need an xml parser f开发者_运维百科or php which can accept xmldata as string (not load-from-file) - any ideas how to do it?

thanks


SimpleXML

To be precise: simplexml_load_string — Interprets a string of XML into an object

object simplexml_load_string ( string $data [, string $class_name = "SimpleXMLElement" [, int $options = 0 [, string $ns [, bool $is_prefix = false ]]]] )

Example:

$string = // your XML string
$xml = simplexml_load_string($string);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜