About
DOM - Element in php.
Operations
- get an attribute
$domElement->getAttribute("src");
- Loop over attributes
if ($domElement->hasAttributes()) {
foreach ($domElement->attributes as $attr) {
$name = $attr->name;
$value = $attr->value;
$node[$name] = $value;
}
}
- get the content
$domElement->textContent;