w3pop.com :: ÍøÂçѧԺ :: PHP :: PHP SimpleXML
The SimpleXML functions lets you convert XML to an object.
SimpleXMLº¯ÊýµÄ×÷ÓÃÊÇ£º½«XMLת»»³ÉÒ»¸ö¶ÔÏó¡£
This object can be processed, like any other object, with normal property selectors and array iterators.
Õâ¸ö¶ÔÏóÊÇ¿ÉÒÔ±»´¦ÀíµÄ£¬ÖîÈçÆäËû¶ÔÏóÒ»Ñù£¬ÓÐÊýÏîÑ¡ÔñÆ÷ºÍÊý×éÉùÃ÷Æ÷¡£
Some of these functions requires the newest PHP build.
ijЩº¯ÊýÒªÇó×îеÄPHPÖ§³Ö¡£
The SimpleXML functions are part of the PHP core. There is no installation needed to use these functions.
SimpleXMLº¯ÊýÊÇPHPºËÐĵÄÒ»²¿·Ö£¬Òò´Ë£¬ÎÞÐèÔÙ°²×°ÕâЩº¯Êý¡£
PHP: indicates the earliest version of PHP that supports the function.
PHP£º×îÔçÖ§³ÖÕâЩº¯ÊýµÄPHP°æ±¾
| Function ²ÎÊý |
Description ÃèÊö |
PHP |
|---|---|---|
| __construct() | Creates a new SimpleXMLElement object ½¨Á¢Ò»¸öеÄSimpleXMLElement¶ÔÏó |
5 |
| addAttribute() | Adds an attribute to the SimpleXML element ½«Ò»¸öÊôÐÔÌí¼Óµ½SimpleXMLÔªËØÖÐ |
5 |
| addChild() | Adds a child element the SimpleXML element ½«Ò»¸ö×ÓÔªËØÌí¼Óµ½SimpleXMLÔªËØÖÐ |
5 |
| asXML() | Gets an XML string from a SimpleXML element ´ÓSimpleXMLÔªËØÖлñȡһ¸öXML×Ö·û´® |
5 |
| attributes() | Gets a SimpleXML element's attributes »ñȡһ¸öSimpleXMLÔªËØµÄÊôÐÔ |
5 |
| children() | Gets the children of a specified node »ñȡһ¸öÖ¸¶¨½ÚµãµÄ×Ó½Úµã |
5 |
| getDocNamespaces() | Gets namespaces of an XML document »ñȡһ¸öXMLÎĵµµÄÃû³Æ¿Õ¼ä[namespace] |
5 |
| getName() | Gets the name of a SimpleXML element »ñÈ¡SimpleXMLÔªËØµÄÃû³Æ |
5 |
| getNamespaces() | Gets namespaces from XML data ´ÓXMLÊý¾ÝÖлñÈ¡Ãû³Æ¿Õ¼ä[namespace] |
5 |
| registerXPathNamespace() | Creates a namespace context for the next XPath query Ϊ½ÓÏÂÀ´µÄXPath²éѯ´´½¨Ò»¸öÃû³Æ¿Õ¼äµÄÄÚÈÝ[namespace] |
5 |
| simplexml_import_dom | Gets a SimpleXMLElement object from a DOM node. ´ÓÒ»¸öDOM½ÚµãÖлñȡһ¸öSimpleXMLElement¶ÔÏó |
5 |
| simplexml_load_file | Gets a SimpleXMLElement object from an XML document ´ÓÒ»¸öXMLÎĵµÖлñȡһ¸öSimpleXMLElement¶ÔÏó |
5 |
| simplexml_load_string | Gets a SimpleXMLElement object from an XML string ´ÓÒ»¸öXML×Ö·û´®Öлñȡһ¸öSimpleXMLElement¶ÔÏó |
5 |
| xpath() | Runs an XPath query on XML data ÔËÐÐÒ»¸öÓëXMLÊý¾ÝÏà¹ØµÄXPath²éѯÓï¾ä |
5 |