SimpleXMLElement class
SimpleXMLElement
Implements:
Stringable, Countable, RecursiveIterator, Traversable, Iterator
Methods #
- __construct()
- -
- __debugInfo()
- -
- __toString()
- -
- addAttribute()
- -
- addChild()
- -
- asXML()
- -
- attributes()
- -
- children()
- -
- count()
- -
- current()
- -
- getChildren()
- -
- getDocNamespaces()
- -
- getName()
- -
- getNamespaces()
- -
- hasChildren()
- -
- key()
- -
- next()
- -
- registerXPathNamespace()
- -
- rewind()
- -
- saveXML()
- -
- valid()
- -
- xpath()
- -
__construct()
public function __construct(string $data, int $options = 0, bool $dataIsURL = false, string $namespaceOrPrefix = '', bool $isPrefix = false)
Parameters
- string $data
- int $options
- bool $dataIsURL
- string $namespaceOrPrefix
- bool $isPrefix
__debugInfo()
public function __debugInfo(): ?array
Returns
?array
__toString()
public function __toString(): string
Returns
string
addAttribute()
public function addAttribute(string $qualifiedName, string $value, ?string $namespace = NULL)
Parameters
- string $qualifiedName
- string $value
- ?string $namespace
addChild()
public function addChild(string $qualifiedName, ?string $value = NULL, ?string $namespace = NULL)
Parameters
- string $qualifiedName
- ?string $value
- ?string $namespace
asXML()
public function asXML(?string $filename = NULL)
Parameters
- ?string $filename
attributes()
public function attributes(?string $namespaceOrPrefix = NULL, bool $isPrefix = false)
Parameters
- ?string $namespaceOrPrefix
- bool $isPrefix
children()
public function children(?string $namespaceOrPrefix = NULL, bool $isPrefix = false)
Parameters
- ?string $namespaceOrPrefix
- bool $isPrefix
count()
public function count()
current()
public function current()
getChildren()
public function getChildren()
getDocNamespaces()
public function getDocNamespaces(bool $recursive = false, bool $fromRoot = true)
Parameters
- bool $recursive
- bool $fromRoot
getName()
public function getName()
getNamespaces()
public function getNamespaces(bool $recursive = false)
Parameters
- bool $recursive
hasChildren()
public function hasChildren()
key()
public function key()
next()
public function next()
registerXPathNamespace()
public function registerXPathNamespace(string $prefix, string $namespace)
Parameters
- string $prefix
- string $namespace
rewind()
public function rewind()
saveXML()
public function saveXML(?string $filename = NULL)
Parameters
- ?string $filename
valid()
public function valid()
xpath()
public function xpath(string $expression)
Parameters
- string $expression