The SimpleXMLElement class
(PHP 5, PHP 7, PHP 8)
簡介
Represents an element in an XML document.
類摘要
/* 方法 */
public __construct(
string
int
bool
string
bool
)
string
$data,int
$options = 0,bool
$dataIsURL = false,string
$namespaceOrPrefix = "",bool
$isPrefix = false)
public addChild(string
}$qualifiedName, ?string $value = null, ?string $namespace = null): ?SimpleXMLElement更新日誌
| 版本 | 說明 |
|---|---|
| 8.0.0 | SimpleXMLElement implements Stringable, Countable, and RecursiveIterator now. |
目錄
- SimpleXMLElement::addAttribute — Adds an attribute to the SimpleXML element
- SimpleXMLElement::addChild — Adds a child element to the XML node
- SimpleXMLElement::asXML — Return a well-formed XML string based on SimpleXML element
- SimpleXMLElement::attributes — Identifies an element's attributes
- SimpleXMLElement::children — Finds children of given node
- SimpleXMLElement::__construct — Creates a new SimpleXMLElement object
- SimpleXMLElement::count — Counts the children of an element
- SimpleXMLElement::getDocNamespaces — Returns namespaces declared in document
- SimpleXMLElement::getName — Gets the name of the XML element
- SimpleXMLElement::getNamespaces — Returns namespaces used in document
- SimpleXMLElement::registerXPathNamespace — Creates a prefix/ns context for the next XPath query
- SimpleXMLElement::saveXML — 別名 SimpleXMLElement::asXML
- SimpleXMLElement::__toString — Returns the string content
- SimpleXMLElement::xpath — Runs XPath query on XML data